@azure/web-pubsub 1.0.0-alpha.20211028.3 → 1.0.0-alpha.20211109.4

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,18 +1,21 @@
1
1
  # Release History
2
2
 
3
- ## 1.0.0-beta.4 (Unreleased)
3
+ ## 1.0.0-beta.4 (2021-11-09)
4
4
 
5
5
  ### Features Added
6
6
 
7
7
  - Support for DefaultAzureCredential
8
- - Added generateClientToken method to the `HubClient`.
9
8
  - Added support for reverse proxies, enabling usage of Web Pubsub with Azure API Management.
9
+ - Added method to close all connections in a hub `serviceClient.closeAllConnections`,
10
+ - Added method to close all connections in a group `groupClient.closeAllConnections`
11
+ - Added method to close all connections for a user `serviceClient.closeUserConnections`.
10
12
 
11
13
  ### Breaking Changes
12
14
 
13
- ### Bugs Fixed
14
-
15
- ### Other Changes
15
+ - Renamed method `getAuthenticationToken` to `getClientAccessToken`
16
+ - Renamed method `hasUser` to `userExists`
17
+ - Renamed method `hasGroup` to `groupExists`
18
+ - Renamed method `hasConnection` to `connnectionExists`
16
19
 
17
20
  ## 1.0.0-beta.3 (2021-07-07)
18
21
 
package/README.md CHANGED
@@ -1,36 +1,24 @@
1
1
  # Azure Web PubSub service client library for JavaScript
2
2
 
3
- [Azure Web PubSub](https://aka.ms/awps/doc) is a service that enables you to build real-time messaging web applications using WebSockets and the publish-subscribe pattern. Any platform supporting WebSocket APIs can connect to the service easily, e.g. web pages, mobile applications, edge devices, etc. The service manages the WebSocket connections for you and allows up to 100K concurrent connections. It provides powerful APIs for you to manage these clients and deliver real-time messages.
3
+ [Azure Web PubSub service](https://aka.ms/awps/doc) is an Azure-managed service that helps developers easily build web applications with real-time features and publish-subscribe pattern. Any scenario that requires real-time publish-subscribe messaging between server and clients or among clients can use Azure Web PubSub service. Traditional real-time features that often require polling from server or submitting HTTP requests can also use Azure Web PubSub service.
4
4
 
5
- Any scenario that requires real-time publish-subscribe messaging between server and clients or among clients, can use Azure Web PubSub service. Traditional real-time features that often require polling from server or submitting HTTP requests, can also use Azure Web PubSub service.
5
+ You can use this library in your app server side to manage the WebSocket client connections, as shown in below diagram:
6
6
 
7
- We list some examples that are good to use Azure Web PubSub service:
8
-
9
- - **High frequency data updates:** gaming, voting, polling, auction.
10
- - **Live dashboards and monitoring:** company dashboard, financial market data, instant sales update, multi-player game leader board, and IoT monitoring.
11
- - **Cross-platform live chat:** live chat room, chat bot, on-line customer support, real-time shopping assistant, messenger, in-game chat, and so on.
12
- - **Real-time location on map:** logistic tracking, delivery status tracking, transportation status updates, GPS apps.
13
- - **Real-time targeted ads:** personalized real-time push ads and offers, interactive ads.
14
- - **Collaborative apps:** coauthoring, whiteboard apps and team meeting software.
15
- - **Push instant notifications:** social network, email, game, travel alert.
16
- - **Real-time broadcasting:** live audio/video broadcasting, live captioning, translating, events/news broadcasting.
17
- - **IoT and connected devices:** real-time IoT metrics, remote control, real-time status, and location tracking.
18
- - **Automation:** real-time trigger from upstream events.
19
-
20
- Use the library to:
7
+ ![overflow](https://user-images.githubusercontent.com/668244/140014067-25a00959-04dc-47e8-ac25-6957bd0a71ce.png).
21
8
 
22
9
  - Send messages to hubs and groups.
23
10
  - Send messages to particular users and connections.
24
11
  - Organize users and connections into groups.
25
12
  - Close connections
26
- - Grant/revoke/check permissions for an existing connection
13
+ - Grant, revoke, and check permissions for an existing connection
27
14
 
28
- Key links:
29
- - [Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/web-pubsub/web-pubsub)
30
- - [Package (NPM)](https://www.npmjs.com/package/@azure/web-pubsub)
31
- - [API reference documentation](https://aka.ms/awps/sdk/js)
32
- - [Product documentation](https://aka.ms/awps/doc)
33
- - [Samples][samples_ref]
15
+ Details about the terms used here are described in [Key concepts](#key-concepts) section.
16
+
17
+ [Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/web-pubsub/web-pubsub) |
18
+ [Package (NPM)](https://www.npmjs.com/package/@azure/web-pubsub) |
19
+ [API reference documentation](https://aka.ms/awps/sdk/js) |
20
+ [Product documentation](https://aka.ms/awps/doc) |
21
+ [Samples][samples_ref]
34
22
 
35
23
  ## Getting started
36
24
 
@@ -66,19 +54,36 @@ const key = new AzureKeyCredential("<Key>");
66
54
  const serviceClient = new WebPubSubServiceClient("<Endpoint>", key, "<hubName>");
67
55
  ```
68
56
 
57
+ Or authenticate the `WebPubSubServiceClient` using [Azure Active Directory][aad_doc]
58
+
59
+ 1. Install the `@azure/identity` dependency
60
+
61
+ ```batch
62
+ npm install @azure/identity
63
+ ```
64
+
65
+ 2. Update the source code to use `DefaultAzureCredential`:
66
+
67
+ ```js
68
+ const { WebPubSubServiceClient, AzureKeyCredential } = require("@azure/web-pubsub");
69
+
70
+ const key = new DefaultAzureCredential();
71
+ const serviceClient = new WebPubSubServiceClient("<Endpoint>", key, "<hubName>");
72
+ ```
73
+
69
74
  ## Key concepts
70
75
 
71
76
  ### Connection
72
77
 
73
- Connections, represented by a connection id, represent an individual websocket connection to the Web PubSub service. Connection id is always unique.
78
+ A connection, also known as a client or a client connection, represents an individual WebSocket connection connected to the Web PubSub service. When successfully connected, a unique connection ID is assigned to this connection by the Web PubSub service.
74
79
 
75
80
  ### Hub
76
81
 
77
- Hub is a logical set of connections. All connections to Web PubSub connect to a specific hub. Messages that are broadcast to the hub are dispatched to all connections to that hub. For example, hub can be used for different applications, different applications can share one Azure Web PubSub service by using different hub names.
82
+ A hub is a logical concept for a set of client connections. Usually you use one hub for one purpose, for example, a chat hub, or a notification hub. When a client connection is created, it connects to a hub, and during its lifetime, it belongs to that hub. Different applications can share one Azure Web PubSub service by using different hub names.
78
83
 
79
84
  ### Group
80
85
 
81
- Group allow broadcast messages to a subset of connections to the hub. You can add and remove users and connections as needed. A client can join multiple groups, and a group can contain multiple clients.
86
+ A group is a subset of connections to the hub. You can add a client connection to a group, or remove the client connection from the group, anytime you want. For example, when a client joins a chat room, or when a client leaves the chat room, this chat room can be considered to be a group. A client can join multiple groups, and a group can contain multiple clients.
82
87
 
83
88
  ### User
84
89
 
@@ -86,37 +91,100 @@ Connections to Web PubSub can belong to one user. A user might have multiple con
86
91
 
87
92
  ### Message
88
93
 
89
- A message is either a UTF-8 encoded string or raw binary data.
94
+ When the client is connected, it can send messages to the upstream application, or receive messages from the upstream application, through the WebSocket connection.
90
95
 
91
96
  ## Examples
92
97
 
93
- ### Broadcast a JSON message to all users
98
+ ### Get the access token for a client to start the WebSocket connection
94
99
 
95
100
  ```js
96
101
  const { WebPubSubServiceClient } = require("@azure/web-pubsub");
97
102
 
98
103
  const serviceClient = new WebPubSubServiceClient("<ConnectionString>", "<hubName>");
99
- await serviceClient.sendToAll({ message: "Hello world!" });
104
+
105
+ // Get the access token for the WebSocket client connection to use
106
+ let token = await serviceClient.getClientAccessToken();
107
+
108
+ // Or get the access token and assign the client a userId
109
+ token = await serviceClient.getClientAccessToken({ userId: "user1" });
110
+
111
+ // return the token to the WebSocket client
100
112
  ```
101
113
 
102
- ### Broadcast a plain text message to all users
114
+ ### Broadcast messages to all connections in a hub
103
115
 
104
116
  ```js
105
117
  const { WebPubSubServiceClient } = require("@azure/web-pubsub");
106
118
 
107
119
  const serviceClient = new WebPubSubServiceClient("<ConnectionString>", "<hubName>");
120
+
121
+ // Send a JSON message
122
+ await serviceClient.sendToAll({ message: "Hello world!" });
123
+
124
+ // Send a plain text message
108
125
  await serviceClient.sendToAll("Hi there!", { contentType: "text/plain" });
126
+
127
+ // Send a binary message
128
+ const payload = new Uint8Array(10);
129
+ await serviceClient.sendToAll(payload.buffer);
130
+ ```
131
+
132
+ ### Send messages to all connections in a group
133
+
134
+ ```js
135
+ const { WebPubSubServiceClient } = require("@azure/web-pubsub");
136
+
137
+ const serviceClient = new WebPubSubServiceClient("<ConnectionString>", "<hubName>");
138
+
139
+ const groupClient = serviceClient.group("<groupName>");
140
+
141
+ // Add user to the group
142
+ await groupClient.addUser("user1");
143
+
144
+ // Send a JSON message
145
+ await groupClient.sendToAll({ message: "Hello world!" });
146
+
147
+ // Send a plain text message
148
+ await groupClient.sendToAll("Hi there!", { contentType: "text/plain" });
149
+
150
+ // Send a binary message
151
+ const payload = new Uint8Array(10);
152
+ await groupClient.sendToAll(payload.buffer);
109
153
  ```
110
154
 
111
- ### Broadcast a binary message to all users
155
+ ### Send messages to all connections for a user
112
156
 
113
157
  ```js
114
158
  const { WebPubSubServiceClient } = require("@azure/web-pubsub");
115
159
 
116
160
  const serviceClient = new WebPubSubServiceClient("<ConnectionString>", "<hubName>");
117
161
 
162
+ // Send a JSON message
163
+ await serviceClient.sendToUser("user1", { message: "Hello world!" });
164
+
165
+ // Send a plain text message
166
+ await serviceClient.sendToUser("user1", "Hi there!", { contentType: "text/plain" });
167
+
168
+ // Send a binary message
118
169
  const payload = new Uint8Array(10);
119
- await serviceClient.sendToAll(payload.buffer);
170
+ await serviceClient.sendToUser("user1", payload.buffer);
171
+ ```
172
+
173
+ ### Check if the group has any connection
174
+
175
+ ```js
176
+ const { WebPubSubServiceClient } = require("@azure/web-pubsub");
177
+ const WebSocket = require("ws");
178
+
179
+ const serviceClient = new WebPubSubServiceClient("<ConnectionString>", "<hubName>");
180
+
181
+ const groupClient = serviceClient.group("<groupName>");
182
+
183
+ // close all the connections in the group
184
+ await groupClient.closeAllConnections({ reason: "<closeReason>" });
185
+
186
+ // check if the group has any connections
187
+ const hasConnections = await serviceClient.groupExists("<groupName>");
120
188
  ```
121
189
 
122
190
  ### Access the raw HTTP response for an operation
@@ -145,6 +213,10 @@ export AZURE_LOG_LEVEL=verbose
145
213
 
146
214
  For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
147
215
 
216
+ ### Live Trace
217
+
218
+ Use **Live Trace** from the Web PubSub service portal to view the live traffic.
219
+
148
220
  ## Next steps
149
221
 
150
222
  Please take a look at the
@@ -161,3 +233,4 @@ If you'd like to contribute to this library, please read the [contributing guide
161
233
 
162
234
  [azure_sub]: https://azure.microsoft.com/free/
163
235
  [samples_ref]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/web-pubsub/web-pubsub/samples
236
+ [aad_doc]: https://aka.ms/awps/aad
package/dist/index.js CHANGED
@@ -1619,7 +1619,7 @@ class WebPubSubGroupImpl {
1619
1619
  * @param options - Additional options
1620
1620
  */
1621
1621
  async closeAllConnections(options = {}) {
1622
- const { span, updatedOptions } = createSpan("WebPubSubServiceClient-hub-closeAllConnections", options);
1622
+ const { span, updatedOptions } = createSpan("WebPubSubServiceClient-group-closeAllConnections", options);
1623
1623
  try {
1624
1624
  return await this.client.webPubSub.closeGroupConnections(this.hubName, this.groupName, updatedOptions);
1625
1625
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/generated/models/mappers.ts","../src/generated/models/parameters.ts","../src/generated/operations/healthApi.ts","../src/generated/operations/webPubSub.ts","../src/generated/generatedClientContext.ts","../src/generated/generatedClient.ts","../src/tracing.ts","../src/utils.ts","../src/groupClient.ts","../src/webPubSubCredentialPolicy.ts","../src/logger.ts","../src/parseConnectionString.ts","../src/reverseProxyPolicy.ts","../src/hubClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\n\nexport const ClientTokenResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ClientTokenResponse\",\n modelProperties: {\n token: {\n serializedName: \"token\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ErrorDetail: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorDetail\",\n modelProperties: {\n code: {\n serializedName: \"code\",\n type: {\n name: \"String\"\n }\n },\n message: {\n serializedName: \"message\",\n type: {\n name: \"String\"\n }\n },\n target: {\n serializedName: \"target\",\n type: {\n name: \"String\"\n }\n },\n details: {\n serializedName: \"details\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"ErrorDetail\"\n }\n }\n }\n },\n inner: {\n serializedName: \"inner\",\n type: {\n name: \"Composite\",\n className: \"InnerError\"\n }\n }\n }\n }\n};\n\nexport const InnerError: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"InnerError\",\n modelProperties: {\n code: {\n serializedName: \"code\",\n type: {\n name: \"String\"\n }\n },\n inner: {\n serializedName: \"inner\",\n type: {\n name: \"Composite\",\n className: \"InnerError\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubGenerateClientTokenExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubGenerateClientTokenExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubCloseAllConnectionsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubCloseAllConnectionsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubSendToAllExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubSendToAllExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubConnectionExistsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubConnectionExistsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubCloseConnectionExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubCloseConnectionExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubSendToConnectionExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubSendToConnectionExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubGroupExistsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubGroupExistsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubCloseGroupConnectionsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubCloseGroupConnectionsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubSendToGroupExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubSendToGroupExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubAddConnectionToGroupExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubAddConnectionToGroupExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubRemoveConnectionFromGroupExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubRemoveConnectionFromGroupExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubUserExistsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubUserExistsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubCloseUserConnectionsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubCloseUserConnectionsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubSendToUserExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubSendToUserExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubAddUserToGroupExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubAddUserToGroupExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubRemoveUserFromGroupExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubRemoveUserFromGroupExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubRemoveUserFromAllGroupsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubRemoveUserFromAllGroupsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubGrantPermissionExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubGrantPermissionExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubRevokePermissionExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubRevokePermissionExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubCheckPermissionExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubCheckPermissionExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n","/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport {\n OperationURLParameter,\n OperationQueryParameter,\n OperationParameter\n} from \"@azure/core-client\";\n\nexport const endpoint: OperationURLParameter = {\n parameterPath: \"endpoint\",\n mapper: {\n serializedName: \"Endpoint\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const apiVersion: OperationQueryParameter = {\n parameterPath: \"apiVersion\",\n mapper: {\n defaultValue: \"2021-10-01\",\n isConstant: true,\n serializedName: \"api-version\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json, text/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const hub: OperationURLParameter = {\n parameterPath: \"hub\",\n mapper: {\n constraints: {\n Pattern: new RegExp(\"^[A-Za-z][A-Za-z0-9_`,.[\\\\]]{0,127}$\")\n },\n serializedName: \"hub\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const userId: OperationQueryParameter = {\n parameterPath: [\"options\", \"userId\"],\n mapper: {\n serializedName: \"userId\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const roles: OperationQueryParameter = {\n parameterPath: [\"options\", \"roles\"],\n mapper: {\n serializedName: \"role\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"Multi\"\n};\n\nexport const expirationTimeInMinutes: OperationQueryParameter = {\n parameterPath: [\"options\", \"expirationTimeInMinutes\"],\n mapper: {\n defaultValue: 60,\n serializedName: \"minutesToExpire\",\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const excluded: OperationQueryParameter = {\n parameterPath: [\"options\", \"excluded\"],\n mapper: {\n serializedName: \"excluded\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"Multi\"\n};\n\nexport const reason: OperationQueryParameter = {\n parameterPath: [\"options\", \"reason\"],\n mapper: {\n serializedName: \"reason\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const contentType: OperationParameter = {\n parameterPath: \"contentType\",\n mapper: {\n serializedName: \"Content-Type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"application/json\", \"application/octet-stream\"]\n }\n }\n};\n\nexport const message: OperationParameter = {\n parameterPath: \"message\",\n mapper: {\n serializedName: \"message\",\n required: true,\n type: {\n name: \"Stream\"\n }\n }\n};\n\nexport const accept1: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json, text/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const contentType1: OperationParameter = {\n parameterPath: \"contentType\",\n mapper: {\n defaultValue: \"text/plain\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const message1: OperationParameter = {\n parameterPath: \"message\",\n mapper: {\n serializedName: \"message\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const accept2: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json, text/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const excludedConnections: OperationQueryParameter = {\n parameterPath: [\"options\", \"excludedConnections\"],\n mapper: {\n serializedName: \"excluded\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"Multi\"\n};\n\nexport const connectionId: OperationURLParameter = {\n parameterPath: \"connectionId\",\n mapper: {\n constraints: {\n MinLength: 1\n },\n serializedName: \"connectionId\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const group: OperationURLParameter = {\n parameterPath: \"group\",\n mapper: {\n constraints: {\n MaxLength: 1024,\n MinLength: 1\n },\n serializedName: \"group\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const userId1: OperationURLParameter = {\n parameterPath: \"userId\",\n mapper: {\n constraints: {\n MinLength: 1\n },\n serializedName: \"userId\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const permission: OperationURLParameter = {\n parameterPath: \"permission\",\n mapper: {\n serializedName: \"permission\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const targetName: OperationQueryParameter = {\n parameterPath: [\"options\", \"targetName\"],\n mapper: {\n serializedName: \"targetName\",\n type: {\n name: \"String\"\n }\n }\n};\n","/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { HealthApi } from \"../operationsInterfaces\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers\";\nimport * as Parameters from \"../models/parameters\";\nimport { GeneratedClientContext } from \"../generatedClientContext\";\nimport { HealthApiGetServiceStatusOptionalParams } from \"../models\";\n\n/** Class containing HealthApi operations. */\nexport class HealthApiImpl implements HealthApi {\n private readonly client: GeneratedClientContext;\n\n /**\n * Initialize a new instance of the class HealthApi class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClientContext) {\n this.client = client;\n }\n\n /**\n * Get service health status.\n * @param options The options parameters.\n */\n getServiceStatus(\n options?: HealthApiGetServiceStatusOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { options },\n getServiceStatusOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getServiceStatusOperationSpec: coreClient.OperationSpec = {\n path: \"/api/health\",\n httpMethod: \"HEAD\",\n responses: { 200: {}, default: {} },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n serializer\n};\n","/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { WebPubSub } from \"../operationsInterfaces\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as Mappers from \"../models/mappers\";\nimport * as Parameters from \"../models/parameters\";\nimport { GeneratedClientContext } from \"../generatedClientContext\";\nimport {\n WebPubSubGenerateClientTokenOptionalParams,\n WebPubSubGenerateClientTokenResponse,\n WebPubSubCloseAllConnectionsOptionalParams,\n ContentType,\n WebPubSubSendToAll$binaryOptionalParams,\n WebPubSubSendToAll$textOptionalParams,\n WebPubSubConnectionExistsOptionalParams,\n WebPubSubCloseConnectionOptionalParams,\n WebPubSubSendToConnection$binaryOptionalParams,\n WebPubSubSendToConnection$textOptionalParams,\n WebPubSubGroupExistsOptionalParams,\n WebPubSubCloseGroupConnectionsOptionalParams,\n WebPubSubSendToGroup$binaryOptionalParams,\n WebPubSubSendToGroup$textOptionalParams,\n WebPubSubAddConnectionToGroupOptionalParams,\n WebPubSubRemoveConnectionFromGroupOptionalParams,\n WebPubSubUserExistsOptionalParams,\n WebPubSubCloseUserConnectionsOptionalParams,\n WebPubSubSendToUser$binaryOptionalParams,\n WebPubSubSendToUser$textOptionalParams,\n WebPubSubAddUserToGroupOptionalParams,\n WebPubSubRemoveUserFromGroupOptionalParams,\n WebPubSubRemoveUserFromAllGroupsOptionalParams,\n WebPubSubPermission,\n WebPubSubGrantPermissionOptionalParams,\n WebPubSubRevokePermissionOptionalParams,\n WebPubSubCheckPermissionOptionalParams\n} from \"../models\";\n\n/** Class containing WebPubSub operations. */\nexport class WebPubSubImpl implements WebPubSub {\n private readonly client: GeneratedClientContext;\n\n /**\n * Initialize a new instance of the class WebPubSub class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClientContext) {\n this.client = client;\n }\n\n /**\n * Generate token for the client to connect Azure Web PubSub service.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param options The options parameters.\n */\n generateClientToken(\n hub: string,\n options?: WebPubSubGenerateClientTokenOptionalParams\n ): Promise<WebPubSubGenerateClientTokenResponse> {\n return this.client.sendOperationRequest(\n { hub, options },\n generateClientTokenOperationSpec\n );\n }\n\n /**\n * Close the connections in the hub.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param options The options parameters.\n */\n closeAllConnections(\n hub: string,\n options?: WebPubSubCloseAllConnectionsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, options },\n closeAllConnectionsOperationSpec\n );\n }\n\n /**\n * Broadcast content inside request body to all the connected client connections.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToAll(\n hub: string,\n contentType: ContentType,\n message: coreRestPipeline.RequestBodyType,\n options?: WebPubSubSendToAll$binaryOptionalParams\n ): Promise<void>;\n /**\n * Broadcast content inside request body to all the connected client connections.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToAll(\n hub: string,\n contentType: \"text/plain\",\n message: string,\n options?: WebPubSubSendToAll$textOptionalParams\n ): Promise<void>;\n /**\n * Broadcast content inside request body to all the connected client connections.\n * @param args Includes all the parameters for this operation.\n */\n sendToAll(\n ...args:\n | [\n string,\n ContentType,\n coreRestPipeline.RequestBodyType,\n WebPubSubSendToAll$binaryOptionalParams?\n ]\n | [string, \"text/plain\", string, WebPubSubSendToAll$textOptionalParams?]\n ): Promise<void> {\n let operationSpec: coreClient.OperationSpec;\n let operationArguments: coreClient.OperationArguments;\n let options;\n if (\n args[1] === \"application/json\" ||\n args[1] === \"application/octet-stream\"\n ) {\n operationSpec = sendToAll$binaryOperationSpec;\n operationArguments = {\n hub: args[0],\n contentType: args[1],\n message: args[2],\n options: args[3]\n };\n options = args[3];\n } else if (args[1] === \"text/plain\") {\n operationSpec = sendToAll$textOperationSpec;\n operationArguments = {\n hub: args[0],\n contentType: args[1],\n message: args[2],\n options: args[3]\n };\n options = args[3];\n } else {\n throw new TypeError(\n `\"contentType\" must be a valid value but instead was \"${args[1]}\".`\n );\n }\n operationArguments.options = options || {};\n return this.client.sendOperationRequest(operationArguments, operationSpec);\n }\n\n /**\n * Check if the connection with the given connectionId exists.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param connectionId The connection Id.\n * @param options The options parameters.\n */\n connectionExists(\n hub: string,\n connectionId: string,\n options?: WebPubSubConnectionExistsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, connectionId, options },\n connectionExistsOperationSpec\n );\n }\n\n /**\n * Close the client connection.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param connectionId Target connection Id.\n * @param options The options parameters.\n */\n closeConnection(\n hub: string,\n connectionId: string,\n options?: WebPubSubCloseConnectionOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, connectionId, options },\n closeConnectionOperationSpec\n );\n }\n\n /**\n * Send content inside request body to the specific connection.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param connectionId The connection Id.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToConnection(\n hub: string,\n connectionId: string,\n contentType: ContentType,\n message: coreRestPipeline.RequestBodyType,\n options?: WebPubSubSendToConnection$binaryOptionalParams\n ): Promise<void>;\n /**\n * Send content inside request body to the specific connection.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param connectionId The connection Id.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToConnection(\n hub: string,\n connectionId: string,\n contentType: \"text/plain\",\n message: string,\n options?: WebPubSubSendToConnection$textOptionalParams\n ): Promise<void>;\n /**\n * Send content inside request body to the specific connection.\n * @param args Includes all the parameters for this operation.\n */\n sendToConnection(\n ...args:\n | [\n string,\n string,\n ContentType,\n coreRestPipeline.RequestBodyType,\n WebPubSubSendToConnection$binaryOptionalParams?\n ]\n | [\n string,\n string,\n \"text/plain\",\n string,\n WebPubSubSendToConnection$textOptionalParams?\n ]\n ): Promise<void> {\n let operationSpec: coreClient.OperationSpec;\n let operationArguments: coreClient.OperationArguments;\n let options;\n if (\n args[2] === \"application/json\" ||\n args[2] === \"application/octet-stream\"\n ) {\n operationSpec = sendToConnection$binaryOperationSpec;\n operationArguments = {\n hub: args[0],\n connectionId: args[1],\n contentType: args[2],\n message: args[3],\n options: args[4]\n };\n options = args[4];\n } else if (args[2] === \"text/plain\") {\n operationSpec = sendToConnection$textOperationSpec;\n operationArguments = {\n hub: args[0],\n connectionId: args[1],\n contentType: args[2],\n message: args[3],\n options: args[4]\n };\n options = args[4];\n } else {\n throw new TypeError(\n `\"contentType\" must be a valid value but instead was \"${args[2]}\".`\n );\n }\n operationArguments.options = options || {};\n return this.client.sendOperationRequest(operationArguments, operationSpec);\n }\n\n /**\n * Check if there are any client connections inside the given group\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param options The options parameters.\n */\n groupExists(\n hub: string,\n group: string,\n options?: WebPubSubGroupExistsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, group, options },\n groupExistsOperationSpec\n );\n }\n\n /**\n * Close connections in the specific group.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param options The options parameters.\n */\n closeGroupConnections(\n hub: string,\n group: string,\n options?: WebPubSubCloseGroupConnectionsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, group, options },\n closeGroupConnectionsOperationSpec\n );\n }\n\n /**\n * Send content inside request body to a group of connections.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToGroup(\n hub: string,\n group: string,\n contentType: ContentType,\n message: coreRestPipeline.RequestBodyType,\n options?: WebPubSubSendToGroup$binaryOptionalParams\n ): Promise<void>;\n /**\n * Send content inside request body to a group of connections.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToGroup(\n hub: string,\n group: string,\n contentType: \"text/plain\",\n message: string,\n options?: WebPubSubSendToGroup$textOptionalParams\n ): Promise<void>;\n /**\n * Send content inside request body to a group of connections.\n * @param args Includes all the parameters for this operation.\n */\n sendToGroup(\n ...args:\n | [\n string,\n string,\n ContentType,\n coreRestPipeline.RequestBodyType,\n WebPubSubSendToGroup$binaryOptionalParams?\n ]\n | [\n string,\n string,\n \"text/plain\",\n string,\n WebPubSubSendToGroup$textOptionalParams?\n ]\n ): Promise<void> {\n let operationSpec: coreClient.OperationSpec;\n let operationArguments: coreClient.OperationArguments;\n let options;\n if (\n args[2] === \"application/json\" ||\n args[2] === \"application/octet-stream\"\n ) {\n operationSpec = sendToGroup$binaryOperationSpec;\n operationArguments = {\n hub: args[0],\n group: args[1],\n contentType: args[2],\n message: args[3],\n options: args[4]\n };\n options = args[4];\n } else if (args[2] === \"text/plain\") {\n operationSpec = sendToGroup$textOperationSpec;\n operationArguments = {\n hub: args[0],\n group: args[1],\n contentType: args[2],\n message: args[3],\n options: args[4]\n };\n options = args[4];\n } else {\n throw new TypeError(\n `\"contentType\" must be a valid value but instead was \"${args[2]}\".`\n );\n }\n operationArguments.options = options || {};\n return this.client.sendOperationRequest(operationArguments, operationSpec);\n }\n\n /**\n * Add a connection to the target group.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param connectionId Target connection Id\n * @param options The options parameters.\n */\n addConnectionToGroup(\n hub: string,\n group: string,\n connectionId: string,\n options?: WebPubSubAddConnectionToGroupOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, group, connectionId, options },\n addConnectionToGroupOperationSpec\n );\n }\n\n /**\n * Remove a connection from the target group.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param connectionId Target connection Id.\n * @param options The options parameters.\n */\n removeConnectionFromGroup(\n hub: string,\n group: string,\n connectionId: string,\n options?: WebPubSubRemoveConnectionFromGroupOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, group, connectionId, options },\n removeConnectionFromGroupOperationSpec\n );\n }\n\n /**\n * Check if there are any client connections connected for the given user.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param userId Target user Id.\n * @param options The options parameters.\n */\n userExists(\n hub: string,\n userId: string,\n options?: WebPubSubUserExistsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, userId, options },\n userExistsOperationSpec\n );\n }\n\n /**\n * Close connections for the specific user.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param userId The user Id.\n * @param options The options parameters.\n */\n closeUserConnections(\n hub: string,\n userId: string,\n options?: WebPubSubCloseUserConnectionsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, userId, options },\n closeUserConnectionsOperationSpec\n );\n }\n\n /**\n * Send content inside request body to the specific user.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param userId The user Id.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToUser(\n hub: string,\n userId: string,\n contentType: ContentType,\n message: coreRestPipeline.RequestBodyType,\n options?: WebPubSubSendToUser$binaryOptionalParams\n ): Promise<void>;\n /**\n * Send content inside request body to the specific user.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param userId The user Id.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToUser(\n hub: string,\n userId: string,\n contentType: \"text/plain\",\n message: string,\n options?: WebPubSubSendToUser$textOptionalParams\n ): Promise<void>;\n /**\n * Send content inside request body to the specific user.\n * @param args Includes all the parameters for this operation.\n */\n sendToUser(\n ...args:\n | [\n string,\n string,\n ContentType,\n coreRestPipeline.RequestBodyType,\n WebPubSubSendToUser$binaryOptionalParams?\n ]\n | [\n string,\n string,\n \"text/plain\",\n string,\n WebPubSubSendToUser$textOptionalParams?\n ]\n ): Promise<void> {\n let operationSpec: coreClient.OperationSpec;\n let operationArguments: coreClient.OperationArguments;\n let options;\n if (\n args[2] === \"application/json\" ||\n args[2] === \"application/octet-stream\"\n ) {\n operationSpec = sendToUser$binaryOperationSpec;\n operationArguments = {\n hub: args[0],\n userId: args[1],\n contentType: args[2],\n message: args[3],\n options: args[4]\n };\n options = args[4];\n } else if (args[2] === \"text/plain\") {\n operationSpec = sendToUser$textOperationSpec;\n operationArguments = {\n hub: args[0],\n userId: args[1],\n contentType: args[2],\n message: args[3],\n options: args[4]\n };\n options = args[4];\n } else {\n throw new TypeError(\n `\"contentType\" must be a valid value but instead was \"${args[2]}\".`\n );\n }\n operationArguments.options = options || {};\n return this.client.sendOperationRequest(operationArguments, operationSpec);\n }\n\n /**\n * Add a user to the target group.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param userId Target user Id.\n * @param options The options parameters.\n */\n addUserToGroup(\n hub: string,\n group: string,\n userId: string,\n options?: WebPubSubAddUserToGroupOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, group, userId, options },\n addUserToGroupOperationSpec\n );\n }\n\n /**\n * Remove a user from the target group.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param userId Target user Id.\n * @param options The options parameters.\n */\n removeUserFromGroup(\n hub: string,\n group: string,\n userId: string,\n options?: WebPubSubRemoveUserFromGroupOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, group, userId, options },\n removeUserFromGroupOperationSpec\n );\n }\n\n /**\n * Remove a user from all groups.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param userId Target user Id.\n * @param options The options parameters.\n */\n removeUserFromAllGroups(\n hub: string,\n userId: string,\n options?: WebPubSubRemoveUserFromAllGroupsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, userId, options },\n removeUserFromAllGroupsOperationSpec\n );\n }\n\n /**\n * Grant permission to the connection.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param permission The permission: current supported actions are joinLeaveGroup and sendToGroup.\n * @param connectionId Target connection Id.\n * @param options The options parameters.\n */\n grantPermission(\n hub: string,\n permission: WebPubSubPermission,\n connectionId: string,\n options?: WebPubSubGrantPermissionOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, permission, connectionId, options },\n grantPermissionOperationSpec\n );\n }\n\n /**\n * Revoke permission for the connection.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param permission The permission: current supported actions are joinLeaveGroup and sendToGroup.\n * @param connectionId Target connection Id.\n * @param options The options parameters.\n */\n revokePermission(\n hub: string,\n permission: WebPubSubPermission,\n connectionId: string,\n options?: WebPubSubRevokePermissionOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, permission, connectionId, options },\n revokePermissionOperationSpec\n );\n }\n\n /**\n * Check if a connection has permission to the specified action.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param permission The permission: current supported actions are joinLeaveGroup and sendToGroup.\n * @param connectionId Target connection Id.\n * @param options The options parameters.\n */\n checkPermission(\n hub: string,\n permission: WebPubSubPermission,\n connectionId: string,\n options?: WebPubSubCheckPermissionOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, permission, connectionId, options },\n checkPermissionOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst generateClientTokenOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/:generateToken\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.ClientTokenResponse\n },\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubGenerateClientTokenExceptionHeaders\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.userId,\n Parameters.roles,\n Parameters.expirationTimeInMinutes\n ],\n urlParameters: [Parameters.endpoint, Parameters.hub],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst closeAllConnectionsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/:closeConnections\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubCloseAllConnectionsExceptionHeaders\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.excluded,\n Parameters.reason\n ],\n urlParameters: [Parameters.endpoint, Parameters.hub],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst sendToAll$binaryOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToAllExceptionHeaders\n }\n },\n requestBody: Parameters.message,\n queryParameters: [Parameters.apiVersion, Parameters.excludedConnections],\n urlParameters: [Parameters.endpoint, Parameters.hub],\n headerParameters: [Parameters.contentType, Parameters.accept1],\n mediaType: \"binary\",\n serializer\n};\nconst sendToAll$textOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToAllExceptionHeaders\n }\n },\n requestBody: Parameters.message1,\n queryParameters: [Parameters.apiVersion, Parameters.excludedConnections],\n urlParameters: [Parameters.endpoint, Parameters.hub],\n headerParameters: [Parameters.contentType1, Parameters.accept2],\n mediaType: \"text\",\n serializer\n};\nconst connectionExistsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/connections/{connectionId}\",\n httpMethod: \"HEAD\",\n responses: {\n 200: {},\n 404: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubConnectionExistsExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.connectionId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst closeConnectionOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/connections/{connectionId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubCloseConnectionExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.reason],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.connectionId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst sendToConnection$binaryOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/connections/{connectionId}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToConnectionExceptionHeaders\n }\n },\n requestBody: Parameters.message,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.connectionId],\n headerParameters: [Parameters.contentType, Parameters.accept1],\n mediaType: \"binary\",\n serializer\n};\nconst sendToConnection$textOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/connections/{connectionId}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToConnectionExceptionHeaders\n }\n },\n requestBody: Parameters.message1,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.connectionId],\n headerParameters: [Parameters.contentType1, Parameters.accept2],\n mediaType: \"text\",\n serializer\n};\nconst groupExistsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/groups/{group}\",\n httpMethod: \"HEAD\",\n responses: {\n 200: {},\n 404: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubGroupExistsExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.group],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst closeGroupConnectionsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/groups/{group}/:closeConnections\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubCloseGroupConnectionsExceptionHeaders\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.excluded,\n Parameters.reason\n ],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.group],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst sendToGroup$binaryOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/groups/{group}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToGroupExceptionHeaders\n }\n },\n requestBody: Parameters.message,\n queryParameters: [Parameters.apiVersion, Parameters.excludedConnections],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.group],\n headerParameters: [Parameters.contentType, Parameters.accept1],\n mediaType: \"binary\",\n serializer\n};\nconst sendToGroup$textOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/groups/{group}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToGroupExceptionHeaders\n }\n },\n requestBody: Parameters.message1,\n queryParameters: [Parameters.apiVersion, Parameters.excludedConnections],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.group],\n headerParameters: [Parameters.contentType1, Parameters.accept2],\n mediaType: \"text\",\n serializer\n};\nconst addConnectionToGroupOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/groups/{group}/connections/{connectionId}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {},\n 404: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubAddConnectionToGroupExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.connectionId,\n Parameters.group\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst removeConnectionFromGroupOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/groups/{group}/connections/{connectionId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubRemoveConnectionFromGroupExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.connectionId,\n Parameters.group\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst userExistsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}\",\n httpMethod: \"HEAD\",\n responses: {\n 200: {},\n 404: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubUserExistsExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.userId1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst closeUserConnectionsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}/:closeConnections\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubCloseUserConnectionsExceptionHeaders\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.excluded,\n Parameters.reason\n ],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.userId1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst sendToUser$binaryOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToUserExceptionHeaders\n }\n },\n requestBody: Parameters.message,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.userId1],\n headerParameters: [Parameters.contentType, Parameters.accept1],\n mediaType: \"binary\",\n serializer\n};\nconst sendToUser$textOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToUserExceptionHeaders\n }\n },\n requestBody: Parameters.message1,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.userId1],\n headerParameters: [Parameters.contentType1, Parameters.accept2],\n mediaType: \"text\",\n serializer\n};\nconst addUserToGroupOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}/groups/{group}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {},\n 404: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubAddUserToGroupExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.group,\n Parameters.userId1\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst removeUserFromGroupOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}/groups/{group}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubRemoveUserFromGroupExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.group,\n Parameters.userId1\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst removeUserFromAllGroupsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}/groups\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubRemoveUserFromAllGroupsExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.userId1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst grantPermissionOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubGrantPermissionExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.targetName],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.connectionId,\n Parameters.permission\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst revokePermissionOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubRevokePermissionExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.targetName],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.connectionId,\n Parameters.permission\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst checkPermissionOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}\",\n httpMethod: \"HEAD\",\n responses: {\n 200: {},\n 404: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubCheckPermissionExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.targetName],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.connectionId,\n Parameters.permission\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\n","/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport { GeneratedClientOptionalParams } from \"./models\";\n\n/** @internal */\nexport class GeneratedClientContext extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the GeneratedClientContext class.\n * @param endpoint HTTP or HTTPS endpoint for the Web PubSub service instance.\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: GeneratedClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: GeneratedClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-web-pubsub/1.0.0-beta.4`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint || \"{Endpoint}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2021-10-01\";\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { HealthApiImpl, WebPubSubImpl } from \"./operations\";\nimport { HealthApi, WebPubSub } from \"./operationsInterfaces\";\nimport { GeneratedClientContext } from \"./generatedClientContext\";\nimport { GeneratedClientOptionalParams } from \"./models\";\n\n/** @internal */\nexport class GeneratedClient extends GeneratedClientContext {\n /**\n * Initializes a new instance of the GeneratedClient class.\n * @param endpoint HTTP or HTTPS endpoint for the Web PubSub service instance.\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: GeneratedClientOptionalParams) {\n super(endpoint, options);\n this.healthApi = new HealthApiImpl(this);\n this.webPubSub = new WebPubSubImpl(this);\n }\n\n healthApi: HealthApi;\n webPubSub: WebPubSub;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createSpanFunction } from \"@azure/core-tracing\";\n\n/** @internal */\nexport const createSpan = createSpanFunction({\n namespace: \"Microsoft.WebPubSub\",\n packagePrefix: \"Azure.Messaging.WebPubSub\"\n});\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestBodyType } from \"@azure/core-rest-pipeline\";\n\nfunction isRequestBody(obj: unknown): obj is RequestBodyType {\n return (\n typeof obj === \"function\" ||\n (typeof obj === \"object\" &&\n obj != null &&\n (obj.constructor.name === \"ArrayBuffer\" ||\n obj.constructor.name === \"Blob\" ||\n ArrayBuffer.isView(obj)))\n );\n}\n\nexport interface TextPlainPayload {\n contentType: \"text/plain\";\n payload: string;\n}\n\nexport interface JsonPayload {\n contentType: \"application/json\";\n payload: string;\n}\n\nexport interface BinaryPayload {\n contentType: \"application/octet-stream\";\n payload: RequestBodyType;\n}\n\nexport type Payload = TextPlainPayload | JsonPayload | BinaryPayload;\n\nexport function getPayloadForMessage(message: unknown, options: Record<string, any>): Payload {\n if (options?.contentType === \"text/plain\") {\n if (typeof message !== \"string\") {\n throw new TypeError(\"Message must be a string.\");\n }\n return { contentType: \"text/plain\", payload: message };\n } else if (isRequestBody(message)) {\n return { contentType: \"application/octet-stream\", payload: message };\n } else {\n return { contentType: \"application/json\", payload: JSON.stringify(message) };\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommonClientOptions, FullOperationResponse, OperationOptions } from \"@azure/core-client\";\nimport { RestError, RequestBodyType } from \"@azure/core-rest-pipeline\";\nimport { GeneratedClient } from \"./generated/generatedClient\";\nimport { createSpan } from \"./tracing\";\nimport { getPayloadForMessage } from \"./utils\";\nimport { JSONTypes } from \"./hubClient\";\n\n/**\n * Options for constructing a GroupAdmin client.\n */\nexport interface GroupAdminClientOptions extends CommonClientOptions {}\n\n/**\n * Options for adding a connection to a group.\n */\nexport interface GroupAddConnectionOptions extends OperationOptions {}\n\n/**\n * Options for adding a user to a group.\n */\nexport interface GroupAddUserOptions extends OperationOptions {}\n\n/**\n * Options for checking if a user is in a group\n */\nexport interface GroupHasUserOptions extends OperationOptions {}\n\n/**\n * Options for removing a user from a group\n */\nexport interface GroupRemoveUserOptions extends OperationOptions {}\n\n/**\n * Options for removing a connection from a group\n */\nexport interface GroupRemoveConnectionOptions extends OperationOptions {}\n\n/**\n * Options for sending messages to a group.\n */\nexport interface GroupSendToAllOptions extends OperationOptions {\n /**\n * Connection ids to exclude from receiving this message.\n */\n excludedConnections?: string[];\n}\n\n/**\n * Options for sending text messages to a group..\n */\nexport interface GroupSendTextToAllOptions extends OperationOptions {\n /**\n * Connection ids to exclude from receiving this message.\n */\n excludedConnections?: string[];\n contentType: \"text/plain\";\n}\n\n/**\n * Options for closing all connections to a group.\n */\nexport interface GroupCloseAllConnectionsOptions extends OperationOptions {\n /**\n * Reason the connection is being closed.\n */\n reason?: string;\n}\n\nexport interface WebPubSubGroup {\n /**\n * The name of this group\n */\n readonly groupName: string;\n\n /**\n * The name of the hub this group belongs to\n */\n readonly hubName: string;\n\n /**\n * The Web PubSub API version being used by this client\n */\n readonly apiVersion: string;\n\n /**\n * The Web PubSub endpoint this client is connected to\n */\n readonly endpoint: string;\n\n /**\n * Add a specific connection to this group\n *\n * @param connectionId - The connection id to add to this group\n * @param options - Additional options\n */\n addConnection(connectionId: string, options?: GroupAddConnectionOptions): Promise<void>;\n\n /**\n * Remove a specific connection from this group\n *\n * @param connectionId - The connection id to remove from this group\n * @param options - Additional options\n */\n removeConnection(connectionId: string, options?: GroupRemoveConnectionOptions): Promise<void>;\n\n /**\n * Add a user to this group\n *\n * @param username - The user name to add\n * @param options - Additional options\n */\n addUser(username: string, options?: GroupAddUserOptions): Promise<void>;\n\n /**\n * Remove a user from this group\n *\n * @param username - The user name to remove\n * @param options - Additional options\n */\n removeUser(username: string, options?: GroupRemoveUserOptions): Promise<void>;\n\n /**\n * Send a text message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n sendToAll(message: string, options: GroupSendTextToAllOptions): Promise<void>;\n /**\n * Send a json message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n sendToAll(message: JSONTypes, options?: GroupSendToAllOptions): Promise<void>;\n /**\n * Send a binary message to every connection in this group\n *\n * @param message - The binary message to send\n * @param options - Additional options\n */\n sendToAll(message: RequestBodyType, options?: GroupSendToAllOptions): Promise<void>;\n}\n\n/**\n * @hidden\n */\nexport class WebPubSubGroupImpl implements WebPubSubGroup {\n private client!: GeneratedClient;\n\n /**\n * The name of this group\n */\n public readonly groupName: string;\n\n /**\n * The name of the hub this group belongs to\n */\n public readonly hubName: string;\n\n /**\n * The Web PubSub API version being used by this client\n */\n public readonly apiVersion: string = \"2020-10-01\";\n\n /**\n * The Web PubSub endpoint this client is connected to\n */\n public endpoint!: string;\n\n /**\n * @internal\n */\n constructor(client: GeneratedClient, hubName: string, groupName: string) {\n this.client = client;\n this.groupName = groupName;\n this.hubName = hubName;\n }\n /**\n * Add a specific connection to this group\n *\n * @param connectionId - The connection id to add to this group\n * @param options - Additional options\n */\n public async addConnection(\n connectionId: string,\n options: GroupAddConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-group-addConnection\",\n options\n );\n\n let response: FullOperationResponse | undefined;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n response = rawResponse;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n await this.client.webPubSub.addConnectionToGroup(this.hubName, this.groupName, connectionId, {\n ...updatedOptions,\n onResponse\n });\n\n if (response!.status === 404) {\n throw new RestError(`Connection id '${connectionId}' doesn't exist`, {\n statusCode: response?.status,\n request: response?.request,\n response: response\n });\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Remove a specific connection from this group\n *\n * @param connectionId - The connection id to remove from this group\n * @param options - Additional options\n */\n public async removeConnection(\n connectionId: string,\n options: GroupRemoveConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-group-removeConnection\",\n options\n );\n\n try {\n await this.client.webPubSub.removeConnectionFromGroup(\n this.hubName,\n this.groupName,\n connectionId,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Close all connections to this group\n *\n * @param options - Additional options\n */\n public async closeAllConnections(options: GroupCloseAllConnectionsOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-closeAllConnections\",\n options\n );\n\n try {\n return await this.client.webPubSub.closeGroupConnections(\n this.hubName,\n this.groupName,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n /**\n * Add a user to this group\n *\n * @param username - The user name to add\n * @param options - Additional options\n */\n public async addUser(username: string, options: GroupAddUserOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-group-addUser\", options);\n\n try {\n await this.client.webPubSub.addUserToGroup(\n this.hubName,\n this.groupName,\n username,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Remove a user from this group\n *\n * @param username - The user name to remove\n * @param options - Additional options\n */\n public async removeUser(username: string, options: GroupRemoveUserOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-group-removeUser\", options);\n\n try {\n await this.client.webPubSub.removeUserFromGroup(\n this.hubName,\n this.groupName,\n username,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Send a text message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n public async sendToAll(message: string, options: GroupSendTextToAllOptions): Promise<void>;\n /**\n * Send a json message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n public async sendToAll(message: JSONTypes, options?: GroupSendToAllOptions): Promise<void>;\n /**\n * Send a binary message to every connection in this group\n *\n * @param message - The binary message to send\n * @param options - Additional options\n */\n public async sendToAll(message: RequestBodyType, options?: GroupSendToAllOptions): Promise<void>;\n\n public async sendToAll(\n message: JSONTypes | RequestBodyType,\n options: GroupSendToAllOptions | GroupSendTextToAllOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-group-sendToAll\", options);\n\n const { contentType, payload } = getPayloadForMessage(message, updatedOptions);\n\n try {\n await this.client.webPubSub.sendToGroup(\n this.hubName,\n this.groupName,\n contentType,\n payload as any,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { KeyCredential } from \"@azure/core-auth\";\nimport {\n PipelineResponse,\n PipelineRequest,\n SendRequest,\n PipelinePolicy\n} from \"@azure/core-rest-pipeline\";\n\nimport jwt from \"jsonwebtoken\";\n\n/**\n * The programmatic identifier of the webPubSubKeyCredentialPolicy.\n */\nexport const webPubSubKeyCredentialPolicyName = \"webPubSubKeyCredentialPolicy\";\n\n/**\n * Create an HTTP pipeline policy to authenticate a request\n * using an `AzureKeyCredential` for Text Analytics\n * @internal\n */\nexport function webPubSubKeyCredentialPolicy(credential: KeyCredential): PipelinePolicy {\n return {\n name: webPubSubKeyCredentialPolicyName,\n sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const bearerToken = jwt.sign({}, credential.key, {\n audience: request.url,\n expiresIn: \"1h\",\n algorithm: \"HS256\"\n });\n request.headers.set(\"Authorization\", `Bearer ${bearerToken}`);\n return next(request);\n }\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The `@azure/logger` configuration for this package.\n */\nexport const logger = createClientLogger(\"web-pubsub\");\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { URL } from \"./util/url\";\n\ninterface ParsedConnectionString {\n credential: AzureKeyCredential;\n endpoint: string;\n}\n\nexport function parseConnectionString(conn: string): ParsedConnectionString {\n const parsed: { [id: string]: string } = {};\n\n conn.split(\";\").forEach((i) => {\n const assignmentPos = i.indexOf(\"=\");\n if (assignmentPos === -1) return;\n const key = i.substring(0, assignmentPos).toLowerCase();\n const value = i.substring(assignmentPos + 1);\n parsed[key] = value;\n });\n\n let endpointPart = parsed[\"endpoint\"];\n if (!endpointPart) throw new TypeError(\"connection string missing endpoint\");\n if (!endpointPart.startsWith(\"http\")) {\n endpointPart = `https://${endpointPart}`;\n }\n const key = parsed[\"accesskey\"];\n if (!key) throw new TypeError(\"connection string missing access key\");\n const credential = new AzureKeyCredential(key);\n const port = parsed[\"port\"];\n const url = new URL(endpointPart);\n url.port = port;\n const endpoint = url.toString();\n url.port = \"\";\n\n return { credential, endpoint };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelineResponse,\n PipelineRequest,\n SendRequest,\n PipelinePolicy\n} from \"@azure/core-rest-pipeline\";\n\nexport const webPubSubReverseProxyPolicyName = \"webPubSubReverseProxyPolicy\";\n\n/**\n * Create an HTTP pipeline policy to use a reverse proxy.\n * This is generally going to be an Azure APIM endpoint.\n * @internal\n */\nexport function webPubSubReverseProxyPolicy(endpoint: string): PipelinePolicy {\n const rpEndpointUrl = new URL(endpoint);\n return {\n name: webPubSubReverseProxyPolicyName,\n sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const parsedUrl = new URL(request.url);\n parsedUrl.host = rpEndpointUrl.host;\n request.url = parsedUrl.toString();\n return next(request);\n }\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommonClientOptions, FullOperationResponse, OperationOptions } from \"@azure/core-client\";\nimport { RestError, RequestBodyType } from \"@azure/core-rest-pipeline\";\nimport { GeneratedClient } from \"./generated/generatedClient\";\nimport { WebPubSubGroup, WebPubSubGroupImpl } from \"./groupClient\";\nimport { AzureKeyCredential, TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { webPubSubKeyCredentialPolicy } from \"./webPubSubCredentialPolicy\";\nimport { createSpan } from \"./tracing\";\nimport { logger } from \"./logger\";\nimport { parseConnectionString } from \"./parseConnectionString\";\nimport jwt from \"jsonwebtoken\";\nimport { getPayloadForMessage } from \"./utils\";\nimport { GeneratedClientOptionalParams } from \"./generated\";\nimport { webPubSubReverseProxyPolicy } from \"./reverseProxyPolicy\";\n\n/**\n * Options for closing a connection to a hub.\n */\nexport interface HubCloseConnectionOptions extends OperationOptions {\n /**\n * Reason the connection is being closed.\n */\n reason?: string;\n}\n\n/**\n * Options for closing all connections to a hub.\n */\nexport interface HubCloseAllConnectionsOptions extends OperationOptions {\n /**\n * Reason the connection is being closed.\n */\n reason?: string;\n}\n\n/**\n * Options for closing all of a user's connections to a hub.\n */\nexport interface HubCloseUserConnectionsOptions extends OperationOptions {\n /**\n * Reason the connection is being closed.\n */\n reason?: string;\n}\n\n/**\n * Options for sending messages to hubs.\n */\nexport interface HubSendToAllOptions extends OperationOptions {\n /**\n * Connection ids to exclude from receiving this message.\n */\n excludedConnections?: string[];\n}\n\n/**\n * Options for sending text messages to hubs.\n */\nexport interface HubSendTextToAllOptions extends HubSendToAllOptions {\n contentType: \"text/plain\";\n}\n\n/**\n * Types which can be serialized and sent as JSON.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type JSONTypes = string | number | boolean | object;\n\n/**\n * Options for constructing a HubAdmin client.\n */\nexport interface WebPubSubServiceClientOptions extends CommonClientOptions {\n /**\n * Reverse proxy endpoint (for example, your Azure API management endpoint)\n */\n reverseProxyEndpoint?: string;\n}\n\n/**\n * Options for checking if a connection exists.\n */\nexport interface HasConnectionOptions extends OperationOptions {}\n\n/**\n * Options for checking if a group exists.\n */\nexport interface HubHasGroupOptions extends OperationOptions {}\n\n/**\n * Options for checking if a user exists.\n */\nexport interface HubHasUserOptions extends OperationOptions {}\n\n/**\n * Options for removing a user from all groups.\n */\nexport interface HubRemoveUserFromAllGroupsOptions extends HubCloseConnectionOptions {}\n\n/**\n * Options for sending a message to a specific connection.\n */\nexport interface HubSendToConnectionOptions extends OperationOptions {}\n\n/**\n * Options for sending a text message to a connection.\n */\nexport interface HubSendTextToConnectionOptions extends HubSendToConnectionOptions {\n contentType: \"text/plain\";\n}\n\n/**\n * Options for sending a message to a user.\n */\nexport interface HubSendToUserOptions extends OperationOptions {}\n\n/**\n * Options for sending a text message to a user.\n */\nexport interface HubSendTextToUserOptions extends HubSendToUserOptions {\n contentType: \"text/plain\";\n}\n\nexport type Permission = \"joinLeaveGroup\" | \"sendToGroup\";\n\n/**\n * Options for grant permissions to a connection\n */\nexport interface HubGrantPermissionOptions extends OperationOptions {\n /**\n * The meaning of the target depends on the specific permission.\n * For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.\n */\n targetName?: string;\n}\n\n/**\n * Options for revoke permissions from a connection\n */\nexport interface HubRevokePermissionOptions extends OperationOptions {\n /**\n * The meaning of the target depends on the specific permission.\n * For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.\n */\n targetName?: string;\n}\n\n/**\n * Options for checking if a connection has the specified permission\n */\nexport interface HubHasPermissionOptions extends OperationOptions {\n /**\n * The meaning of the target depends on the specific permission.\n * For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.\n */\n targetName?: string;\n}\n\n/**\n * Options for generating a token to connect a client to the Azure Web Pubsub service.\n */\nexport interface GenerateClientTokenOptions extends OperationOptions {\n /**\n * The userId for the client.\n */\n userId?: string;\n\n /**\n * The roles that the connection with the generated token will have.\n * Roles give the client initial permissions to leave, join, or publish to groups when using PubSub subprotocol\n * * `webpubsub.joinLeaveGroup`: the client can join or leave any group\n * * `webpubsub.sendToGroup`: the client can send messages to any group\n * * `webpubsub.joinLeaveGroup.<group>`: the client can join or leave group `<group>`\n * * `webpubsub.sendToGroup.<group>`: the client can send messages to group `<group>`\n *\n * {@link https://azure.github.io/azure-webpubsub/references/pubsub-websocket-subprotocol#permissions}\n */\n roles?: string[];\n\n /**\n * Minutes until the token expires.\n */\n expirationTimeInMinutes?: number;\n}\n\n/**\n * A response containing the client token.\n */\nexport interface ClientTokenResponse {\n /**\n * The client token.\n */\n token: string;\n /**\n * The URL client connects to\n */\n baseUrl: string;\n /**\n * The URL client connects to with access_token query string\n */\n url: string;\n}\n\n/**\n * Client for connecting to a Web PubSub hub\n */\nexport class WebPubSubServiceClient {\n private readonly client: GeneratedClient;\n private credential!: AzureKeyCredential | TokenCredential;\n private readonly clientOptions?: WebPubSubServiceClientOptions;\n\n /**\n * The name of the hub this client is connected to\n */\n public readonly hubName: string;\n /**\n * The Web PubSub API version being used by this client\n */\n public readonly apiVersion: string = \"2021-10-01\";\n\n /**\n * The Web PubSub endpoint this client is connected to\n */\n public endpoint!: string;\n\n /**\n * Creates an instance of a WebPubSubServiceClient for sending messages and managing groups, connections, and users.\n *\n * Example usage:\n * ```ts\n * import { WebPubSubServiceClient } from \"@azure/web-pubsub\";\n * const connectionString = process.env['WEB_PUBSUB_CONNECTION_STRING'];\n * const client = new WebPubSubServiceClient(connectionString, 'chat');\n * ```\n *\n * @param connectionString - The connection string\n * @param hubName - The name of the hub to connect to. If omitted, '_default' is used.\n * @param options - Options to configure the http pipeline\n */\n constructor(connectionString: string, hubName: string, options?: WebPubSubServiceClientOptions);\n\n /**\n * Creates an instance of a WebPubSubServiceClient for sending messages and managing groups, connections, and users.\n *\n * Example usage:\n * ```ts\n * import { WebPubSubServiceClient, AzureKeyCredential } from \"@azure/web-pubsub\";\n * const cred = new AzureKeyCredential(\"<your web pubsub api key>\");\n * const endpoint = \"https://xxxx.webpubsubdev.azure.com\"\n * const client = new WebPubSubServiceClient(endpoint, cred, 'chat');\n * ```\n *\n * @param endpoint - The endpoint to connect to\n * @param credential - An AzureKeyCredential holding your service key\n * @param hubName - The name of the hub to connect to.\n * @param options - Options to configure the http pipeline\n */\n constructor(\n endpoint: string,\n credential: AzureKeyCredential | TokenCredential,\n hubName: string,\n options?: WebPubSubServiceClientOptions\n );\n constructor(\n endpointOrConnectionString: string,\n credsOrHubName?: AzureKeyCredential | TokenCredential | string,\n hubNameOrOpts?: string | WebPubSubServiceClientOptions,\n opts?: WebPubSubServiceClientOptions\n ) {\n // unpack constructor arguments\n if (typeof credsOrHubName === \"object\") {\n this.endpoint = endpointOrConnectionString;\n this.hubName = hubNameOrOpts as string;\n this.clientOptions = opts;\n this.credential = credsOrHubName;\n } else {\n const parsedCs = parseConnectionString(endpointOrConnectionString);\n this.endpoint = parsedCs.endpoint;\n this.credential = parsedCs.credential;\n this.hubName = credsOrHubName as string;\n this.clientOptions = hubNameOrOpts as WebPubSubServiceClientOptions;\n }\n\n const internalPipelineOptions: GeneratedClientOptionalParams = {\n ...this.clientOptions,\n ...{\n apiVersion: this.apiVersion,\n loggingOptions: {\n logger: logger.info\n }\n },\n ...(isTokenCredential(this.credential)\n ? {\n credential: this.credential,\n credentialScopes: [\"https://webpubsub.azure.com/.default\"]\n }\n : {})\n };\n\n this.client = new GeneratedClient(this.endpoint, internalPipelineOptions);\n\n if (!isTokenCredential(this.credential)) {\n this.client.pipeline.addPolicy(webPubSubKeyCredentialPolicy(this.credential));\n }\n\n if (this.clientOptions?.reverseProxyEndpoint) {\n this.client.pipeline.addPolicy(\n webPubSubReverseProxyPolicy(this.clientOptions?.reverseProxyEndpoint)\n );\n }\n }\n\n /**\n * Get a client for a group\n * @param groupName - The name of the group to connect to.\n */\n public group(groupName: string): WebPubSubGroup {\n return new WebPubSubGroupImpl(this.client, this.hubName, groupName);\n }\n\n /**\n * Broadcast a text message to all connections on this hub.\n *\n * @param message - The text message to send\n * @param options - Additional options\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public async sendToAll(message: string, options: HubSendTextToAllOptions): Promise<void>;\n /**\n * Broadcast a JSON message to all connections on this hub.\n *\n * @param message - The JSON message to send\n * @param options - Additional options\n */\n public async sendToAll(message: JSONTypes, options?: HubSendToAllOptions): Promise<void>;\n /**\n * Broadcast a binary message to all connections on this hub.\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n public async sendToAll(message: RequestBodyType, options?: HubSendToAllOptions): Promise<void>;\n\n public async sendToAll(\n message: RequestBodyType | JSONTypes,\n options: HubSendToAllOptions | HubSendTextToAllOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-hub-sendToAll\", options);\n\n const { contentType, payload } = getPayloadForMessage(message, updatedOptions);\n\n try {\n return await this.client.webPubSub.sendToAll(\n this.hubName,\n contentType,\n payload as any,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Send a text message to a specific user\n *\n * @param username - User name to send to\n * @param message - The text message to send\n * @param options - Additional options\n */\n public async sendToUser(\n username: string,\n message: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: HubSendTextToUserOptions\n ): Promise<void>;\n\n /**\n * Send a JSON message to a specific user\n *\n * @param username - User name to send to\n * @param message - The josn message to send\n * @param options - Additional options\n */\n public async sendToUser(\n username: string,\n message: JSONTypes,\n options?: HubSendToUserOptions\n ): Promise<void>;\n\n /**\n * Send a binary message to a specific user\n *\n * @param username - The user name to send to\n * @param message - The binary message to send\n * @param options - Additional options\n */\n public async sendToUser(\n username: string,\n message: RequestBodyType,\n options?: HubSendToUserOptions | HubSendTextToUserOptions\n ): Promise<void>;\n public async sendToUser(\n username: string,\n message: RequestBodyType | JSONTypes,\n options: HubSendToUserOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-hub-sendToUser\", options);\n\n const { contentType, payload } = getPayloadForMessage(message, updatedOptions);\n try {\n return await this.client.webPubSub.sendToUser(\n this.hubName,\n username,\n contentType,\n payload as any,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Send a text message to a specific connection\n *\n * @param connectionId - Connection id to send to\n * @param message - The text message\n * @param options - Additional options\n */\n public async sendToConnection(\n connectionId: string,\n message: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: HubSendTextToConnectionOptions\n ): Promise<void>;\n\n /**\n * Send a binary message to a specific connection\n *\n * @param connectionId - Connection id to send to\n * @param message - The JSON message\n * @param options - Additional options\n */\n public async sendToConnection(\n connectionId: string,\n message: JSONTypes,\n options?: HubSendToConnectionOptions\n ): Promise<void>;\n\n /**\n * Send a binary message to a specific connection\n *\n * @param connectionId - Connection id to send to\n * @param message - The binary message\n * @param options - Additional options\n */\n public async sendToConnection(\n connectionId: string,\n message: RequestBodyType,\n options?: HubSendToConnectionOptions | HubSendTextToConnectionOptions\n ): Promise<void>;\n public async sendToConnection(\n connectionId: string,\n message: RequestBodyType | JSONTypes,\n options: HubSendToConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-sendToConnection\",\n options\n );\n const { contentType, payload } = getPayloadForMessage(message, updatedOptions);\n\n try {\n return await this.client.webPubSub.sendToConnection(\n this.hubName,\n connectionId,\n contentType,\n payload as any,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Check if a specific connection is connected to this hub\n *\n * @param connectionId - Connection id to check\n * @param options - Additional options\n */\n public async connectionExists(\n connectionId: string,\n options: HasConnectionOptions = {}\n ): Promise<boolean> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-hasConnection\",\n options\n );\n\n let response: FullOperationResponse | undefined;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n response = rawResponse;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n await this.client.webPubSub.connectionExists(this.hubName, connectionId, {\n ...updatedOptions,\n onResponse\n });\n\n if (response!.status === 200) {\n return true;\n } else if (response!.status === 404) {\n return false;\n } else {\n // this is sad - wish this was handled by autorest.\n throw new RestError(response!.bodyAsText!, {\n statusCode: response?.status,\n request: response?.request,\n response: response\n });\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Close a specific connection to this hub\n *\n * @param connectionId - Connection id to close\n * @param options - Additional options\n */\n public async closeConnection(\n connectionId: string,\n options: HubCloseConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-closeConnection\",\n options\n );\n\n try {\n return await this.client.webPubSub.closeConnection(\n this.hubName,\n connectionId,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Close all connections to this hub\n *\n * @param options - Additional options\n */\n public async closeAllConnections(options: HubCloseAllConnectionsOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-closeAllConnections\",\n options\n );\n\n try {\n return await this.client.webPubSub.closeAllConnections(this.hubName, updatedOptions);\n } finally {\n span.end();\n }\n }\n\n /**\n * Close all connections with the given user id\n *\n * @param user - User id to close\n * @param options - Additional options\n */\n public async closeUserConnections(\n userId: string,\n options: HubCloseUserConnectionsOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-closeUserConnections\",\n options\n );\n\n try {\n return await this.client.webPubSub.closeUserConnections(this.hubName, userId, updatedOptions);\n } finally {\n span.end();\n }\n }\n\n /**\n * Remove a specific user from all groups they are joined to\n * @param userId - The user id to remove from all groups\n * @param options - Additional options\n */\n public async removeUserFromAllGroups(\n userId: string,\n options: HubCloseConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-removeUserFromAllGroups\",\n options\n );\n\n try {\n await this.client.webPubSub.removeUserFromAllGroups(this.hubName, userId, updatedOptions);\n } finally {\n span.end();\n }\n }\n\n /**\n * Check if a particular group exists (i.e. has active connections).\n *\n * @param groupName - The group name to check for\n * @param options - Additional options\n */\n public async groupExists(groupName: string, options: HubHasGroupOptions = {}): Promise<boolean> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-hub-hasGroup\", options);\n let response: FullOperationResponse | undefined;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n response = rawResponse;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n await this.client.webPubSub.groupExists(this.hubName, groupName, {\n ...updatedOptions,\n onResponse\n });\n\n if (response!.status === 200) {\n return true;\n } else if (response!.status === 404) {\n return false;\n } else {\n throw new RestError(response!.bodyAsText!, {\n statusCode: response?.status,\n request: response?.request,\n response: response\n });\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Check if a particular user is connected to this hub.\n *\n * @param username - The user name to check for\n * @param options - Additional options\n */\n public async userExists(username: string, options: HubHasUserOptions = {}): Promise<boolean> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-hub-hasUser\", options);\n\n let response: FullOperationResponse | undefined;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n response = rawResponse;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n await this.client.webPubSub.userExists(this.hubName, username, {\n ...updatedOptions,\n onResponse\n });\n\n if (response!.status === 200) {\n return true;\n } else if (response!.status === 404) {\n return false;\n } else {\n // this is sad - wish this was handled by autorest.\n throw new RestError(response!.bodyAsText!, {\n statusCode: response?.status,\n request: response?.request,\n response: response\n });\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Grant permissions to a connection\n *\n * @param connectionId - The connection id to grant permissions to\n * @param Permission - The permission to grant\n * @param options - Additional options\n */\n public async grantPermission(\n connectionId: string,\n permission: Permission,\n options: HubGrantPermissionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-grantPermission\",\n options\n );\n\n try {\n return await this.client.webPubSub.grantPermission(\n this.hubName,\n permission,\n connectionId,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Revoke permissions from a connection\n *\n * @param connectionId - The connection id to revoke permissions from\n * @param Permission - The permission to revoke\n * @param options - Additional options\n */\n public async revokePermission(\n connectionId: string,\n permission: Permission,\n options: HubRevokePermissionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-revokePermission\",\n options\n );\n\n try {\n return await this.client.webPubSub.revokePermission(\n this.hubName,\n permission,\n connectionId,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Check if the connection has the specified permission\n *\n * @param connectionId - The connection id to check permission\n * @param Permission - The permission to check\n * @param options - Additional options\n */\n public async hasPermission(\n connectionId: string,\n permission: Permission,\n options: HubHasPermissionOptions = {}\n ): Promise<boolean> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-hasPermission\",\n options\n );\n let response: FullOperationResponse | undefined;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n response = rawResponse;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n await this.client.webPubSub.checkPermission(this.hubName, permission, connectionId, {\n ...updatedOptions,\n onResponse\n });\n\n if (response!.status === 200) {\n return true;\n } else if (response!.status === 404) {\n return false;\n } else {\n // this is sad - wish this was handled by autorest.\n throw new RestError(response!.bodyAsText!, {\n statusCode: response?.status,\n request: response?.request,\n response: response\n });\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Generate a token for a client to connect to the Azure Web PubSub service.\n *\n * @param options - Additional options\n */\n public async getClientAccessToken(\n options: GenerateClientTokenOptions = {}\n ): Promise<ClientTokenResponse> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-generateClientToken\",\n options\n );\n\n try {\n const endpoint = this.endpoint.endsWith(\"/\") ? this.endpoint : this.endpoint + \"/\";\n const clientEndpoint = endpoint.replace(/(http)(s?:\\/\\/)/gi, \"ws$2\");\n const baseUrl = `${clientEndpoint}client/hubs/${this.hubName}`;\n\n let token: string;\n if (isTokenCredential(this.credential)) {\n const response = await this.client.webPubSub.generateClientToken(\n this.hubName,\n updatedOptions\n );\n token = response.token!;\n } else {\n const key = this.credential.key;\n const audience = `${endpoint}client/hubs/${this.hubName}`;\n const payload = { role: options?.roles };\n const signOptions: jwt.SignOptions = {\n audience: audience,\n expiresIn:\n options?.expirationTimeInMinutes === undefined\n ? \"1h\"\n : `${options.expirationTimeInMinutes}m`,\n algorithm: \"HS256\"\n };\n if (options?.userId) {\n signOptions.subject = options?.userId;\n }\n token = jwt.sign(payload, key, signOptions);\n }\n\n return {\n token,\n baseUrl,\n url: `${baseUrl}?access_token=${token}`\n };\n } finally {\n span.end();\n }\n }\n}\n"],"names":["coreClient.createSerializer","Parameters.apiVersion","Parameters.endpoint","serializer","Mappers.ClientTokenResponse","Mappers.ErrorDetail","Mappers.WebPubSubGenerateClientTokenExceptionHeaders","Parameters.userId","Parameters.roles","Parameters.expirationTimeInMinutes","Parameters.hub","Parameters.accept","Mappers.WebPubSubCloseAllConnectionsExceptionHeaders","Parameters.excluded","Parameters.reason","Mappers.WebPubSubSendToAllExceptionHeaders","Parameters.message","Parameters.excludedConnections","Parameters.contentType","Parameters.accept1","Parameters.message1","Parameters.contentType1","Parameters.accept2","Mappers.WebPubSubConnectionExistsExceptionHeaders","Parameters.connectionId","Mappers.WebPubSubCloseConnectionExceptionHeaders","Mappers.WebPubSubSendToConnectionExceptionHeaders","Mappers.WebPubSubGroupExistsExceptionHeaders","Parameters.group","Mappers.WebPubSubCloseGroupConnectionsExceptionHeaders","Mappers.WebPubSubSendToGroupExceptionHeaders","Mappers.WebPubSubAddConnectionToGroupExceptionHeaders","Mappers.WebPubSubRemoveConnectionFromGroupExceptionHeaders","Mappers.WebPubSubUserExistsExceptionHeaders","Parameters.userId1","Mappers.WebPubSubCloseUserConnectionsExceptionHeaders","Mappers.WebPubSubSendToUserExceptionHeaders","Mappers.WebPubSubAddUserToGroupExceptionHeaders","Mappers.WebPubSubRemoveUserFromGroupExceptionHeaders","Mappers.WebPubSubRemoveUserFromAllGroupsExceptionHeaders","Mappers.WebPubSubGrantPermissionExceptionHeaders","Parameters.targetName","Parameters.permission","Mappers.WebPubSubRevokePermissionExceptionHeaders","Mappers.WebPubSubCheckPermissionExceptionHeaders","coreClient.ServiceClient","createSpanFunction","RestError","createClientLogger","AzureKeyCredential","url","URL","isTokenCredential"],"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;AAUO,MAAM,mBAAmB,GAA+B;IAC7D,IAAI,EAAE;QACJ,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,qBAAqB;QAChC,eAAe,EAAE;YACf,KAAK,EAAE;gBACL,cAAc,EAAE,OAAO;gBACvB,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;KACF;CACF,CAAC;AAEK,MAAM,WAAW,GAA+B;IACrD,IAAI,EAAE;QACJ,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,aAAa;QACxB,eAAe,EAAE;YACf,IAAI,EAAE;gBACJ,cAAc,EAAE,MAAM;gBACtB,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,OAAO,EAAE;gBACP,cAAc,EAAE,SAAS;gBACzB,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,MAAM,EAAE;gBACN,cAAc,EAAE,QAAQ;gBACxB,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,OAAO,EAAE;gBACP,cAAc,EAAE,SAAS;gBACzB,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU;oBAChB,OAAO,EAAE;wBACP,IAAI,EAAE;4BACJ,IAAI,EAAE,WAAW;4BACjB,SAAS,EAAE,aAAa;yBACzB;qBACF;iBACF;aACF;YACD,KAAK,EAAE;gBACL,cAAc,EAAE,OAAO;gBACvB,IAAI,EAAE;oBACJ,IAAI,EAAE,WAAW;oBACjB,SAAS,EAAE,YAAY;iBACxB;aACF;SACF;KACF;CACF,CAAC;AAEK,MAAM,UAAU,GAA+B;IACpD,IAAI,EA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GAAoB;oBACnC,QAAQ,EAAE,QAAQ;oBAClB,SAAS,EACP,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,uBAAuB,MAAK,SAAS;0BAC1C,IAAI;0BACJ,GAAG,OAAO,CAAC,uBAAuB,GAAG;oBAC3C,SAAS,EAAE,OAAO;iBACnB,CAAC;gBACF,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE;oBACnB,WAAW,CAAC,OAAO,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC;iBACvC;gBACD,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC;aAC7C;YAED,OAAO;gBACL,KAAK;gBACL,OAAO;gBACP,GAAG,EAAE,GAAG,OAAO,iBAAiB,KAAK,EAAE;aACxC,CAAC;SACH;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;KACF;CACF;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/generated/models/mappers.ts","../src/generated/models/parameters.ts","../src/generated/operations/healthApi.ts","../src/generated/operations/webPubSub.ts","../src/generated/generatedClientContext.ts","../src/generated/generatedClient.ts","../src/tracing.ts","../src/utils.ts","../src/groupClient.ts","../src/webPubSubCredentialPolicy.ts","../src/logger.ts","../src/parseConnectionString.ts","../src/reverseProxyPolicy.ts","../src/hubClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\n\nexport const ClientTokenResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ClientTokenResponse\",\n modelProperties: {\n token: {\n serializedName: \"token\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ErrorDetail: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorDetail\",\n modelProperties: {\n code: {\n serializedName: \"code\",\n type: {\n name: \"String\"\n }\n },\n message: {\n serializedName: \"message\",\n type: {\n name: \"String\"\n }\n },\n target: {\n serializedName: \"target\",\n type: {\n name: \"String\"\n }\n },\n details: {\n serializedName: \"details\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"ErrorDetail\"\n }\n }\n }\n },\n inner: {\n serializedName: \"inner\",\n type: {\n name: \"Composite\",\n className: \"InnerError\"\n }\n }\n }\n }\n};\n\nexport const InnerError: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"InnerError\",\n modelProperties: {\n code: {\n serializedName: \"code\",\n type: {\n name: \"String\"\n }\n },\n inner: {\n serializedName: \"inner\",\n type: {\n name: \"Composite\",\n className: \"InnerError\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubGenerateClientTokenExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubGenerateClientTokenExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubCloseAllConnectionsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubCloseAllConnectionsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubSendToAllExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubSendToAllExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubConnectionExistsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubConnectionExistsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubCloseConnectionExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubCloseConnectionExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubSendToConnectionExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubSendToConnectionExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubGroupExistsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubGroupExistsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubCloseGroupConnectionsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubCloseGroupConnectionsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubSendToGroupExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubSendToGroupExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubAddConnectionToGroupExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubAddConnectionToGroupExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubRemoveConnectionFromGroupExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubRemoveConnectionFromGroupExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubUserExistsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubUserExistsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubCloseUserConnectionsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubCloseUserConnectionsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubSendToUserExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubSendToUserExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubAddUserToGroupExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubAddUserToGroupExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubRemoveUserFromGroupExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubRemoveUserFromGroupExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubRemoveUserFromAllGroupsExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubRemoveUserFromAllGroupsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubGrantPermissionExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubGrantPermissionExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubRevokePermissionExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubRevokePermissionExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const WebPubSubCheckPermissionExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"WebPubSubCheckPermissionExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n","/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport {\n OperationURLParameter,\n OperationQueryParameter,\n OperationParameter\n} from \"@azure/core-client\";\n\nexport const endpoint: OperationURLParameter = {\n parameterPath: \"endpoint\",\n mapper: {\n serializedName: \"Endpoint\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const apiVersion: OperationQueryParameter = {\n parameterPath: \"apiVersion\",\n mapper: {\n defaultValue: \"2021-10-01\",\n isConstant: true,\n serializedName: \"api-version\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json, text/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const hub: OperationURLParameter = {\n parameterPath: \"hub\",\n mapper: {\n constraints: {\n Pattern: new RegExp(\"^[A-Za-z][A-Za-z0-9_`,.[\\\\]]{0,127}$\")\n },\n serializedName: \"hub\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const userId: OperationQueryParameter = {\n parameterPath: [\"options\", \"userId\"],\n mapper: {\n serializedName: \"userId\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const roles: OperationQueryParameter = {\n parameterPath: [\"options\", \"roles\"],\n mapper: {\n serializedName: \"role\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"Multi\"\n};\n\nexport const expirationTimeInMinutes: OperationQueryParameter = {\n parameterPath: [\"options\", \"expirationTimeInMinutes\"],\n mapper: {\n defaultValue: 60,\n serializedName: \"minutesToExpire\",\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const excluded: OperationQueryParameter = {\n parameterPath: [\"options\", \"excluded\"],\n mapper: {\n serializedName: \"excluded\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"Multi\"\n};\n\nexport const reason: OperationQueryParameter = {\n parameterPath: [\"options\", \"reason\"],\n mapper: {\n serializedName: \"reason\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const contentType: OperationParameter = {\n parameterPath: \"contentType\",\n mapper: {\n serializedName: \"Content-Type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"application/json\", \"application/octet-stream\"]\n }\n }\n};\n\nexport const message: OperationParameter = {\n parameterPath: \"message\",\n mapper: {\n serializedName: \"message\",\n required: true,\n type: {\n name: \"Stream\"\n }\n }\n};\n\nexport const accept1: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json, text/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const contentType1: OperationParameter = {\n parameterPath: \"contentType\",\n mapper: {\n defaultValue: \"text/plain\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const message1: OperationParameter = {\n parameterPath: \"message\",\n mapper: {\n serializedName: \"message\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const accept2: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json, text/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const excludedConnections: OperationQueryParameter = {\n parameterPath: [\"options\", \"excludedConnections\"],\n mapper: {\n serializedName: \"excluded\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"Multi\"\n};\n\nexport const connectionId: OperationURLParameter = {\n parameterPath: \"connectionId\",\n mapper: {\n constraints: {\n MinLength: 1\n },\n serializedName: \"connectionId\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const group: OperationURLParameter = {\n parameterPath: \"group\",\n mapper: {\n constraints: {\n MaxLength: 1024,\n MinLength: 1\n },\n serializedName: \"group\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const userId1: OperationURLParameter = {\n parameterPath: \"userId\",\n mapper: {\n constraints: {\n MinLength: 1\n },\n serializedName: \"userId\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const permission: OperationURLParameter = {\n parameterPath: \"permission\",\n mapper: {\n serializedName: \"permission\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const targetName: OperationQueryParameter = {\n parameterPath: [\"options\", \"targetName\"],\n mapper: {\n serializedName: \"targetName\",\n type: {\n name: \"String\"\n }\n }\n};\n","/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { HealthApi } from \"../operationsInterfaces\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers\";\nimport * as Parameters from \"../models/parameters\";\nimport { GeneratedClientContext } from \"../generatedClientContext\";\nimport { HealthApiGetServiceStatusOptionalParams } from \"../models\";\n\n/** Class containing HealthApi operations. */\nexport class HealthApiImpl implements HealthApi {\n private readonly client: GeneratedClientContext;\n\n /**\n * Initialize a new instance of the class HealthApi class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClientContext) {\n this.client = client;\n }\n\n /**\n * Get service health status.\n * @param options The options parameters.\n */\n getServiceStatus(\n options?: HealthApiGetServiceStatusOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { options },\n getServiceStatusOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getServiceStatusOperationSpec: coreClient.OperationSpec = {\n path: \"/api/health\",\n httpMethod: \"HEAD\",\n responses: { 200: {}, default: {} },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n serializer\n};\n","/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { WebPubSub } from \"../operationsInterfaces\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as Mappers from \"../models/mappers\";\nimport * as Parameters from \"../models/parameters\";\nimport { GeneratedClientContext } from \"../generatedClientContext\";\nimport {\n WebPubSubGenerateClientTokenOptionalParams,\n WebPubSubGenerateClientTokenResponse,\n WebPubSubCloseAllConnectionsOptionalParams,\n ContentType,\n WebPubSubSendToAll$binaryOptionalParams,\n WebPubSubSendToAll$textOptionalParams,\n WebPubSubConnectionExistsOptionalParams,\n WebPubSubCloseConnectionOptionalParams,\n WebPubSubSendToConnection$binaryOptionalParams,\n WebPubSubSendToConnection$textOptionalParams,\n WebPubSubGroupExistsOptionalParams,\n WebPubSubCloseGroupConnectionsOptionalParams,\n WebPubSubSendToGroup$binaryOptionalParams,\n WebPubSubSendToGroup$textOptionalParams,\n WebPubSubAddConnectionToGroupOptionalParams,\n WebPubSubRemoveConnectionFromGroupOptionalParams,\n WebPubSubUserExistsOptionalParams,\n WebPubSubCloseUserConnectionsOptionalParams,\n WebPubSubSendToUser$binaryOptionalParams,\n WebPubSubSendToUser$textOptionalParams,\n WebPubSubAddUserToGroupOptionalParams,\n WebPubSubRemoveUserFromGroupOptionalParams,\n WebPubSubRemoveUserFromAllGroupsOptionalParams,\n WebPubSubPermission,\n WebPubSubGrantPermissionOptionalParams,\n WebPubSubRevokePermissionOptionalParams,\n WebPubSubCheckPermissionOptionalParams\n} from \"../models\";\n\n/** Class containing WebPubSub operations. */\nexport class WebPubSubImpl implements WebPubSub {\n private readonly client: GeneratedClientContext;\n\n /**\n * Initialize a new instance of the class WebPubSub class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClientContext) {\n this.client = client;\n }\n\n /**\n * Generate token for the client to connect Azure Web PubSub service.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param options The options parameters.\n */\n generateClientToken(\n hub: string,\n options?: WebPubSubGenerateClientTokenOptionalParams\n ): Promise<WebPubSubGenerateClientTokenResponse> {\n return this.client.sendOperationRequest(\n { hub, options },\n generateClientTokenOperationSpec\n );\n }\n\n /**\n * Close the connections in the hub.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param options The options parameters.\n */\n closeAllConnections(\n hub: string,\n options?: WebPubSubCloseAllConnectionsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, options },\n closeAllConnectionsOperationSpec\n );\n }\n\n /**\n * Broadcast content inside request body to all the connected client connections.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToAll(\n hub: string,\n contentType: ContentType,\n message: coreRestPipeline.RequestBodyType,\n options?: WebPubSubSendToAll$binaryOptionalParams\n ): Promise<void>;\n /**\n * Broadcast content inside request body to all the connected client connections.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToAll(\n hub: string,\n contentType: \"text/plain\",\n message: string,\n options?: WebPubSubSendToAll$textOptionalParams\n ): Promise<void>;\n /**\n * Broadcast content inside request body to all the connected client connections.\n * @param args Includes all the parameters for this operation.\n */\n sendToAll(\n ...args:\n | [\n string,\n ContentType,\n coreRestPipeline.RequestBodyType,\n WebPubSubSendToAll$binaryOptionalParams?\n ]\n | [string, \"text/plain\", string, WebPubSubSendToAll$textOptionalParams?]\n ): Promise<void> {\n let operationSpec: coreClient.OperationSpec;\n let operationArguments: coreClient.OperationArguments;\n let options;\n if (\n args[1] === \"application/json\" ||\n args[1] === \"application/octet-stream\"\n ) {\n operationSpec = sendToAll$binaryOperationSpec;\n operationArguments = {\n hub: args[0],\n contentType: args[1],\n message: args[2],\n options: args[3]\n };\n options = args[3];\n } else if (args[1] === \"text/plain\") {\n operationSpec = sendToAll$textOperationSpec;\n operationArguments = {\n hub: args[0],\n contentType: args[1],\n message: args[2],\n options: args[3]\n };\n options = args[3];\n } else {\n throw new TypeError(\n `\"contentType\" must be a valid value but instead was \"${args[1]}\".`\n );\n }\n operationArguments.options = options || {};\n return this.client.sendOperationRequest(operationArguments, operationSpec);\n }\n\n /**\n * Check if the connection with the given connectionId exists.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param connectionId The connection Id.\n * @param options The options parameters.\n */\n connectionExists(\n hub: string,\n connectionId: string,\n options?: WebPubSubConnectionExistsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, connectionId, options },\n connectionExistsOperationSpec\n );\n }\n\n /**\n * Close the client connection.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param connectionId Target connection Id.\n * @param options The options parameters.\n */\n closeConnection(\n hub: string,\n connectionId: string,\n options?: WebPubSubCloseConnectionOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, connectionId, options },\n closeConnectionOperationSpec\n );\n }\n\n /**\n * Send content inside request body to the specific connection.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param connectionId The connection Id.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToConnection(\n hub: string,\n connectionId: string,\n contentType: ContentType,\n message: coreRestPipeline.RequestBodyType,\n options?: WebPubSubSendToConnection$binaryOptionalParams\n ): Promise<void>;\n /**\n * Send content inside request body to the specific connection.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param connectionId The connection Id.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToConnection(\n hub: string,\n connectionId: string,\n contentType: \"text/plain\",\n message: string,\n options?: WebPubSubSendToConnection$textOptionalParams\n ): Promise<void>;\n /**\n * Send content inside request body to the specific connection.\n * @param args Includes all the parameters for this operation.\n */\n sendToConnection(\n ...args:\n | [\n string,\n string,\n ContentType,\n coreRestPipeline.RequestBodyType,\n WebPubSubSendToConnection$binaryOptionalParams?\n ]\n | [\n string,\n string,\n \"text/plain\",\n string,\n WebPubSubSendToConnection$textOptionalParams?\n ]\n ): Promise<void> {\n let operationSpec: coreClient.OperationSpec;\n let operationArguments: coreClient.OperationArguments;\n let options;\n if (\n args[2] === \"application/json\" ||\n args[2] === \"application/octet-stream\"\n ) {\n operationSpec = sendToConnection$binaryOperationSpec;\n operationArguments = {\n hub: args[0],\n connectionId: args[1],\n contentType: args[2],\n message: args[3],\n options: args[4]\n };\n options = args[4];\n } else if (args[2] === \"text/plain\") {\n operationSpec = sendToConnection$textOperationSpec;\n operationArguments = {\n hub: args[0],\n connectionId: args[1],\n contentType: args[2],\n message: args[3],\n options: args[4]\n };\n options = args[4];\n } else {\n throw new TypeError(\n `\"contentType\" must be a valid value but instead was \"${args[2]}\".`\n );\n }\n operationArguments.options = options || {};\n return this.client.sendOperationRequest(operationArguments, operationSpec);\n }\n\n /**\n * Check if there are any client connections inside the given group\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param options The options parameters.\n */\n groupExists(\n hub: string,\n group: string,\n options?: WebPubSubGroupExistsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, group, options },\n groupExistsOperationSpec\n );\n }\n\n /**\n * Close connections in the specific group.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param options The options parameters.\n */\n closeGroupConnections(\n hub: string,\n group: string,\n options?: WebPubSubCloseGroupConnectionsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, group, options },\n closeGroupConnectionsOperationSpec\n );\n }\n\n /**\n * Send content inside request body to a group of connections.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToGroup(\n hub: string,\n group: string,\n contentType: ContentType,\n message: coreRestPipeline.RequestBodyType,\n options?: WebPubSubSendToGroup$binaryOptionalParams\n ): Promise<void>;\n /**\n * Send content inside request body to a group of connections.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToGroup(\n hub: string,\n group: string,\n contentType: \"text/plain\",\n message: string,\n options?: WebPubSubSendToGroup$textOptionalParams\n ): Promise<void>;\n /**\n * Send content inside request body to a group of connections.\n * @param args Includes all the parameters for this operation.\n */\n sendToGroup(\n ...args:\n | [\n string,\n string,\n ContentType,\n coreRestPipeline.RequestBodyType,\n WebPubSubSendToGroup$binaryOptionalParams?\n ]\n | [\n string,\n string,\n \"text/plain\",\n string,\n WebPubSubSendToGroup$textOptionalParams?\n ]\n ): Promise<void> {\n let operationSpec: coreClient.OperationSpec;\n let operationArguments: coreClient.OperationArguments;\n let options;\n if (\n args[2] === \"application/json\" ||\n args[2] === \"application/octet-stream\"\n ) {\n operationSpec = sendToGroup$binaryOperationSpec;\n operationArguments = {\n hub: args[0],\n group: args[1],\n contentType: args[2],\n message: args[3],\n options: args[4]\n };\n options = args[4];\n } else if (args[2] === \"text/plain\") {\n operationSpec = sendToGroup$textOperationSpec;\n operationArguments = {\n hub: args[0],\n group: args[1],\n contentType: args[2],\n message: args[3],\n options: args[4]\n };\n options = args[4];\n } else {\n throw new TypeError(\n `\"contentType\" must be a valid value but instead was \"${args[2]}\".`\n );\n }\n operationArguments.options = options || {};\n return this.client.sendOperationRequest(operationArguments, operationSpec);\n }\n\n /**\n * Add a connection to the target group.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param connectionId Target connection Id\n * @param options The options parameters.\n */\n addConnectionToGroup(\n hub: string,\n group: string,\n connectionId: string,\n options?: WebPubSubAddConnectionToGroupOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, group, connectionId, options },\n addConnectionToGroupOperationSpec\n );\n }\n\n /**\n * Remove a connection from the target group.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param connectionId Target connection Id.\n * @param options The options parameters.\n */\n removeConnectionFromGroup(\n hub: string,\n group: string,\n connectionId: string,\n options?: WebPubSubRemoveConnectionFromGroupOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, group, connectionId, options },\n removeConnectionFromGroupOperationSpec\n );\n }\n\n /**\n * Check if there are any client connections connected for the given user.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param userId Target user Id.\n * @param options The options parameters.\n */\n userExists(\n hub: string,\n userId: string,\n options?: WebPubSubUserExistsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, userId, options },\n userExistsOperationSpec\n );\n }\n\n /**\n * Close connections for the specific user.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param userId The user Id.\n * @param options The options parameters.\n */\n closeUserConnections(\n hub: string,\n userId: string,\n options?: WebPubSubCloseUserConnectionsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, userId, options },\n closeUserConnectionsOperationSpec\n );\n }\n\n /**\n * Send content inside request body to the specific user.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param userId The user Id.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToUser(\n hub: string,\n userId: string,\n contentType: ContentType,\n message: coreRestPipeline.RequestBodyType,\n options?: WebPubSubSendToUser$binaryOptionalParams\n ): Promise<void>;\n /**\n * Send content inside request body to the specific user.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param userId The user Id.\n * @param contentType Upload file type\n * @param message The payload body.\n * @param options The options parameters.\n */\n sendToUser(\n hub: string,\n userId: string,\n contentType: \"text/plain\",\n message: string,\n options?: WebPubSubSendToUser$textOptionalParams\n ): Promise<void>;\n /**\n * Send content inside request body to the specific user.\n * @param args Includes all the parameters for this operation.\n */\n sendToUser(\n ...args:\n | [\n string,\n string,\n ContentType,\n coreRestPipeline.RequestBodyType,\n WebPubSubSendToUser$binaryOptionalParams?\n ]\n | [\n string,\n string,\n \"text/plain\",\n string,\n WebPubSubSendToUser$textOptionalParams?\n ]\n ): Promise<void> {\n let operationSpec: coreClient.OperationSpec;\n let operationArguments: coreClient.OperationArguments;\n let options;\n if (\n args[2] === \"application/json\" ||\n args[2] === \"application/octet-stream\"\n ) {\n operationSpec = sendToUser$binaryOperationSpec;\n operationArguments = {\n hub: args[0],\n userId: args[1],\n contentType: args[2],\n message: args[3],\n options: args[4]\n };\n options = args[4];\n } else if (args[2] === \"text/plain\") {\n operationSpec = sendToUser$textOperationSpec;\n operationArguments = {\n hub: args[0],\n userId: args[1],\n contentType: args[2],\n message: args[3],\n options: args[4]\n };\n options = args[4];\n } else {\n throw new TypeError(\n `\"contentType\" must be a valid value but instead was \"${args[2]}\".`\n );\n }\n operationArguments.options = options || {};\n return this.client.sendOperationRequest(operationArguments, operationSpec);\n }\n\n /**\n * Add a user to the target group.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param userId Target user Id.\n * @param options The options parameters.\n */\n addUserToGroup(\n hub: string,\n group: string,\n userId: string,\n options?: WebPubSubAddUserToGroupOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, group, userId, options },\n addUserToGroupOperationSpec\n );\n }\n\n /**\n * Remove a user from the target group.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param group Target group name, which length should be greater than 0 and less than 1025.\n * @param userId Target user Id.\n * @param options The options parameters.\n */\n removeUserFromGroup(\n hub: string,\n group: string,\n userId: string,\n options?: WebPubSubRemoveUserFromGroupOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, group, userId, options },\n removeUserFromGroupOperationSpec\n );\n }\n\n /**\n * Remove a user from all groups.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param userId Target user Id.\n * @param options The options parameters.\n */\n removeUserFromAllGroups(\n hub: string,\n userId: string,\n options?: WebPubSubRemoveUserFromAllGroupsOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, userId, options },\n removeUserFromAllGroupsOperationSpec\n );\n }\n\n /**\n * Grant permission to the connection.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param permission The permission: current supported actions are joinLeaveGroup and sendToGroup.\n * @param connectionId Target connection Id.\n * @param options The options parameters.\n */\n grantPermission(\n hub: string,\n permission: WebPubSubPermission,\n connectionId: string,\n options?: WebPubSubGrantPermissionOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, permission, connectionId, options },\n grantPermissionOperationSpec\n );\n }\n\n /**\n * Revoke permission for the connection.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param permission The permission: current supported actions are joinLeaveGroup and sendToGroup.\n * @param connectionId Target connection Id.\n * @param options The options parameters.\n */\n revokePermission(\n hub: string,\n permission: WebPubSubPermission,\n connectionId: string,\n options?: WebPubSubRevokePermissionOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, permission, connectionId, options },\n revokePermissionOperationSpec\n );\n }\n\n /**\n * Check if a connection has permission to the specified action.\n * @param hub Target hub name, which should start with alphabetic characters and only contain\n * alpha-numeric characters or underscore.\n * @param permission The permission: current supported actions are joinLeaveGroup and sendToGroup.\n * @param connectionId Target connection Id.\n * @param options The options parameters.\n */\n checkPermission(\n hub: string,\n permission: WebPubSubPermission,\n connectionId: string,\n options?: WebPubSubCheckPermissionOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { hub, permission, connectionId, options },\n checkPermissionOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst generateClientTokenOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/:generateToken\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.ClientTokenResponse\n },\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubGenerateClientTokenExceptionHeaders\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.userId,\n Parameters.roles,\n Parameters.expirationTimeInMinutes\n ],\n urlParameters: [Parameters.endpoint, Parameters.hub],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst closeAllConnectionsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/:closeConnections\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubCloseAllConnectionsExceptionHeaders\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.excluded,\n Parameters.reason\n ],\n urlParameters: [Parameters.endpoint, Parameters.hub],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst sendToAll$binaryOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToAllExceptionHeaders\n }\n },\n requestBody: Parameters.message,\n queryParameters: [Parameters.apiVersion, Parameters.excludedConnections],\n urlParameters: [Parameters.endpoint, Parameters.hub],\n headerParameters: [Parameters.contentType, Parameters.accept1],\n mediaType: \"binary\",\n serializer\n};\nconst sendToAll$textOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToAllExceptionHeaders\n }\n },\n requestBody: Parameters.message1,\n queryParameters: [Parameters.apiVersion, Parameters.excludedConnections],\n urlParameters: [Parameters.endpoint, Parameters.hub],\n headerParameters: [Parameters.contentType1, Parameters.accept2],\n mediaType: \"text\",\n serializer\n};\nconst connectionExistsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/connections/{connectionId}\",\n httpMethod: \"HEAD\",\n responses: {\n 200: {},\n 404: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubConnectionExistsExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.connectionId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst closeConnectionOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/connections/{connectionId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubCloseConnectionExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.reason],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.connectionId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst sendToConnection$binaryOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/connections/{connectionId}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToConnectionExceptionHeaders\n }\n },\n requestBody: Parameters.message,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.connectionId],\n headerParameters: [Parameters.contentType, Parameters.accept1],\n mediaType: \"binary\",\n serializer\n};\nconst sendToConnection$textOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/connections/{connectionId}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToConnectionExceptionHeaders\n }\n },\n requestBody: Parameters.message1,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.connectionId],\n headerParameters: [Parameters.contentType1, Parameters.accept2],\n mediaType: \"text\",\n serializer\n};\nconst groupExistsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/groups/{group}\",\n httpMethod: \"HEAD\",\n responses: {\n 200: {},\n 404: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubGroupExistsExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.group],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst closeGroupConnectionsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/groups/{group}/:closeConnections\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubCloseGroupConnectionsExceptionHeaders\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.excluded,\n Parameters.reason\n ],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.group],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst sendToGroup$binaryOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/groups/{group}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToGroupExceptionHeaders\n }\n },\n requestBody: Parameters.message,\n queryParameters: [Parameters.apiVersion, Parameters.excludedConnections],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.group],\n headerParameters: [Parameters.contentType, Parameters.accept1],\n mediaType: \"binary\",\n serializer\n};\nconst sendToGroup$textOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/groups/{group}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToGroupExceptionHeaders\n }\n },\n requestBody: Parameters.message1,\n queryParameters: [Parameters.apiVersion, Parameters.excludedConnections],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.group],\n headerParameters: [Parameters.contentType1, Parameters.accept2],\n mediaType: \"text\",\n serializer\n};\nconst addConnectionToGroupOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/groups/{group}/connections/{connectionId}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {},\n 404: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubAddConnectionToGroupExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.connectionId,\n Parameters.group\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst removeConnectionFromGroupOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/groups/{group}/connections/{connectionId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubRemoveConnectionFromGroupExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.connectionId,\n Parameters.group\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst userExistsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}\",\n httpMethod: \"HEAD\",\n responses: {\n 200: {},\n 404: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubUserExistsExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.userId1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst closeUserConnectionsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}/:closeConnections\",\n httpMethod: \"POST\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubCloseUserConnectionsExceptionHeaders\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.excluded,\n Parameters.reason\n ],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.userId1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst sendToUser$binaryOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToUserExceptionHeaders\n }\n },\n requestBody: Parameters.message,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.userId1],\n headerParameters: [Parameters.contentType, Parameters.accept1],\n mediaType: \"binary\",\n serializer\n};\nconst sendToUser$textOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}/:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubSendToUserExceptionHeaders\n }\n },\n requestBody: Parameters.message1,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.userId1],\n headerParameters: [Parameters.contentType1, Parameters.accept2],\n mediaType: \"text\",\n serializer\n};\nconst addUserToGroupOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}/groups/{group}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {},\n 404: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubAddUserToGroupExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.group,\n Parameters.userId1\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst removeUserFromGroupOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}/groups/{group}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubRemoveUserFromGroupExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.group,\n Parameters.userId1\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst removeUserFromAllGroupsOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/users/{userId}/groups\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubRemoveUserFromAllGroupsExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.hub, Parameters.userId1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst grantPermissionOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubGrantPermissionExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.targetName],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.connectionId,\n Parameters.permission\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst revokePermissionOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubRevokePermissionExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.targetName],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.connectionId,\n Parameters.permission\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst checkPermissionOperationSpec: coreClient.OperationSpec = {\n path: \"/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}\",\n httpMethod: \"HEAD\",\n responses: {\n 200: {},\n 404: {},\n default: {\n bodyMapper: Mappers.ErrorDetail,\n headersMapper: Mappers.WebPubSubCheckPermissionExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.targetName],\n urlParameters: [\n Parameters.endpoint,\n Parameters.hub,\n Parameters.connectionId,\n Parameters.permission\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\n","/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport { GeneratedClientOptionalParams } from \"./models\";\n\n/** @internal */\nexport class GeneratedClientContext extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the GeneratedClientContext class.\n * @param endpoint HTTP or HTTPS endpoint for the Web PubSub service instance.\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: GeneratedClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: GeneratedClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-web-pubsub/1.0.0-beta.4`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint || \"{Endpoint}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2021-10-01\";\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { HealthApiImpl, WebPubSubImpl } from \"./operations\";\nimport { HealthApi, WebPubSub } from \"./operationsInterfaces\";\nimport { GeneratedClientContext } from \"./generatedClientContext\";\nimport { GeneratedClientOptionalParams } from \"./models\";\n\n/** @internal */\nexport class GeneratedClient extends GeneratedClientContext {\n /**\n * Initializes a new instance of the GeneratedClient class.\n * @param endpoint HTTP or HTTPS endpoint for the Web PubSub service instance.\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: GeneratedClientOptionalParams) {\n super(endpoint, options);\n this.healthApi = new HealthApiImpl(this);\n this.webPubSub = new WebPubSubImpl(this);\n }\n\n healthApi: HealthApi;\n webPubSub: WebPubSub;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createSpanFunction } from \"@azure/core-tracing\";\n\n/** @internal */\nexport const createSpan = createSpanFunction({\n namespace: \"Microsoft.WebPubSub\",\n packagePrefix: \"Azure.Messaging.WebPubSub\"\n});\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestBodyType } from \"@azure/core-rest-pipeline\";\n\nfunction isRequestBody(obj: unknown): obj is RequestBodyType {\n return (\n typeof obj === \"function\" ||\n (typeof obj === \"object\" &&\n obj != null &&\n (obj.constructor.name === \"ArrayBuffer\" ||\n obj.constructor.name === \"Blob\" ||\n ArrayBuffer.isView(obj)))\n );\n}\n\nexport interface TextPlainPayload {\n contentType: \"text/plain\";\n payload: string;\n}\n\nexport interface JsonPayload {\n contentType: \"application/json\";\n payload: string;\n}\n\nexport interface BinaryPayload {\n contentType: \"application/octet-stream\";\n payload: RequestBodyType;\n}\n\nexport type Payload = TextPlainPayload | JsonPayload | BinaryPayload;\n\nexport function getPayloadForMessage(message: unknown, options: Record<string, any>): Payload {\n if (options?.contentType === \"text/plain\") {\n if (typeof message !== \"string\") {\n throw new TypeError(\"Message must be a string.\");\n }\n return { contentType: \"text/plain\", payload: message };\n } else if (isRequestBody(message)) {\n return { contentType: \"application/octet-stream\", payload: message };\n } else {\n return { contentType: \"application/json\", payload: JSON.stringify(message) };\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommonClientOptions, FullOperationResponse, OperationOptions } from \"@azure/core-client\";\nimport { RestError, RequestBodyType } from \"@azure/core-rest-pipeline\";\nimport { GeneratedClient } from \"./generated/generatedClient\";\nimport { createSpan } from \"./tracing\";\nimport { getPayloadForMessage } from \"./utils\";\nimport { JSONTypes } from \"./hubClient\";\n\n/**\n * Options for constructing a GroupAdmin client.\n */\nexport interface GroupAdminClientOptions extends CommonClientOptions {}\n\n/**\n * Options for adding a connection to a group.\n */\nexport interface GroupAddConnectionOptions extends OperationOptions {}\n\n/**\n * Options for adding a user to a group.\n */\nexport interface GroupAddUserOptions extends OperationOptions {}\n\n/**\n * Options for checking if a user is in a group\n */\nexport interface GroupHasUserOptions extends OperationOptions {}\n\n/**\n * Options for removing a user from a group\n */\nexport interface GroupRemoveUserOptions extends OperationOptions {}\n\n/**\n * Options for removing a connection from a group\n */\nexport interface GroupRemoveConnectionOptions extends OperationOptions {}\n\n/**\n * Options for sending messages to a group.\n */\nexport interface GroupSendToAllOptions extends OperationOptions {\n /**\n * Connection ids to exclude from receiving this message.\n */\n excludedConnections?: string[];\n}\n\n/**\n * Options for sending text messages to a group..\n */\nexport interface GroupSendTextToAllOptions extends OperationOptions {\n /**\n * Connection ids to exclude from receiving this message.\n */\n excludedConnections?: string[];\n contentType: \"text/plain\";\n}\n\n/**\n * Options for closing all connections to a group.\n */\nexport interface GroupCloseAllConnectionsOptions extends OperationOptions {\n /**\n * Reason the connection is being closed.\n */\n reason?: string;\n}\n\nexport interface WebPubSubGroup {\n /**\n * The name of this group\n */\n readonly groupName: string;\n\n /**\n * The name of the hub this group belongs to\n */\n readonly hubName: string;\n\n /**\n * The Web PubSub API version being used by this client\n */\n readonly apiVersion: string;\n\n /**\n * The Web PubSub endpoint this client is connected to\n */\n readonly endpoint: string;\n\n /**\n * Add a specific connection to this group\n *\n * @param connectionId - The connection id to add to this group\n * @param options - Additional options\n */\n addConnection(connectionId: string, options?: GroupAddConnectionOptions): Promise<void>;\n\n /**\n * Remove a specific connection from this group\n *\n * @param connectionId - The connection id to remove from this group\n * @param options - Additional options\n */\n removeConnection(connectionId: string, options?: GroupRemoveConnectionOptions): Promise<void>;\n\n /**\n * Close all connections to the group\n *\n * @param options - Additional options\n */\n closeAllConnections(options?: GroupCloseAllConnectionsOptions): Promise<void>;\n\n /**\n * Add a user to this group\n *\n * @param username - The user name to add\n * @param options - Additional options\n */\n addUser(username: string, options?: GroupAddUserOptions): Promise<void>;\n\n /**\n * Remove a user from this group\n *\n * @param username - The user name to remove\n * @param options - Additional options\n */\n removeUser(username: string, options?: GroupRemoveUserOptions): Promise<void>;\n\n /**\n * Send a text message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n sendToAll(message: string, options: GroupSendTextToAllOptions): Promise<void>;\n /**\n * Send a json message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n sendToAll(message: JSONTypes, options?: GroupSendToAllOptions): Promise<void>;\n /**\n * Send a binary message to every connection in this group\n *\n * @param message - The binary message to send\n * @param options - Additional options\n */\n sendToAll(message: RequestBodyType, options?: GroupSendToAllOptions): Promise<void>;\n}\n\n/**\n * @hidden\n */\nexport class WebPubSubGroupImpl implements WebPubSubGroup {\n private client!: GeneratedClient;\n\n /**\n * The name of this group\n */\n public readonly groupName: string;\n\n /**\n * The name of the hub this group belongs to\n */\n public readonly hubName: string;\n\n /**\n * The Web PubSub API version being used by this client\n */\n public readonly apiVersion: string = \"2020-10-01\";\n\n /**\n * The Web PubSub endpoint this client is connected to\n */\n public endpoint!: string;\n\n /**\n * @internal\n */\n constructor(client: GeneratedClient, hubName: string, groupName: string) {\n this.client = client;\n this.groupName = groupName;\n this.hubName = hubName;\n }\n /**\n * Add a specific connection to this group\n *\n * @param connectionId - The connection id to add to this group\n * @param options - Additional options\n */\n public async addConnection(\n connectionId: string,\n options: GroupAddConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-group-addConnection\",\n options\n );\n\n let response: FullOperationResponse | undefined;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n response = rawResponse;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n await this.client.webPubSub.addConnectionToGroup(this.hubName, this.groupName, connectionId, {\n ...updatedOptions,\n onResponse\n });\n\n if (response!.status === 404) {\n throw new RestError(`Connection id '${connectionId}' doesn't exist`, {\n statusCode: response?.status,\n request: response?.request,\n response: response\n });\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Remove a specific connection from this group\n *\n * @param connectionId - The connection id to remove from this group\n * @param options - Additional options\n */\n public async removeConnection(\n connectionId: string,\n options: GroupRemoveConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-group-removeConnection\",\n options\n );\n\n try {\n await this.client.webPubSub.removeConnectionFromGroup(\n this.hubName,\n this.groupName,\n connectionId,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Close all connections to this group\n *\n * @param options - Additional options\n */\n public async closeAllConnections(options: GroupCloseAllConnectionsOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-group-closeAllConnections\",\n options\n );\n\n try {\n return await this.client.webPubSub.closeGroupConnections(\n this.hubName,\n this.groupName,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n /**\n * Add a user to this group\n *\n * @param username - The user name to add\n * @param options - Additional options\n */\n public async addUser(username: string, options: GroupAddUserOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-group-addUser\", options);\n\n try {\n await this.client.webPubSub.addUserToGroup(\n this.hubName,\n this.groupName,\n username,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Remove a user from this group\n *\n * @param username - The user name to remove\n * @param options - Additional options\n */\n public async removeUser(username: string, options: GroupRemoveUserOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-group-removeUser\", options);\n\n try {\n await this.client.webPubSub.removeUserFromGroup(\n this.hubName,\n this.groupName,\n username,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Send a text message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n public async sendToAll(message: string, options: GroupSendTextToAllOptions): Promise<void>;\n /**\n * Send a json message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n public async sendToAll(message: JSONTypes, options?: GroupSendToAllOptions): Promise<void>;\n /**\n * Send a binary message to every connection in this group\n *\n * @param message - The binary message to send\n * @param options - Additional options\n */\n public async sendToAll(message: RequestBodyType, options?: GroupSendToAllOptions): Promise<void>;\n\n public async sendToAll(\n message: JSONTypes | RequestBodyType,\n options: GroupSendToAllOptions | GroupSendTextToAllOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-group-sendToAll\", options);\n\n const { contentType, payload } = getPayloadForMessage(message, updatedOptions);\n\n try {\n await this.client.webPubSub.sendToGroup(\n this.hubName,\n this.groupName,\n contentType,\n payload as any,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { KeyCredential } from \"@azure/core-auth\";\nimport {\n PipelineResponse,\n PipelineRequest,\n SendRequest,\n PipelinePolicy\n} from \"@azure/core-rest-pipeline\";\n\nimport jwt from \"jsonwebtoken\";\n\n/**\n * The programmatic identifier of the webPubSubKeyCredentialPolicy.\n */\nexport const webPubSubKeyCredentialPolicyName = \"webPubSubKeyCredentialPolicy\";\n\n/**\n * Create an HTTP pipeline policy to authenticate a request\n * using an `AzureKeyCredential` for Text Analytics\n * @internal\n */\nexport function webPubSubKeyCredentialPolicy(credential: KeyCredential): PipelinePolicy {\n return {\n name: webPubSubKeyCredentialPolicyName,\n sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const bearerToken = jwt.sign({}, credential.key, {\n audience: request.url,\n expiresIn: \"1h\",\n algorithm: \"HS256\"\n });\n request.headers.set(\"Authorization\", `Bearer ${bearerToken}`);\n return next(request);\n }\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The `@azure/logger` configuration for this package.\n */\nexport const logger = createClientLogger(\"web-pubsub\");\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { URL } from \"./util/url\";\n\ninterface ParsedConnectionString {\n credential: AzureKeyCredential;\n endpoint: string;\n}\n\nexport function parseConnectionString(conn: string): ParsedConnectionString {\n const parsed: { [id: string]: string } = {};\n\n conn.split(\";\").forEach((i) => {\n const assignmentPos = i.indexOf(\"=\");\n if (assignmentPos === -1) return;\n const key = i.substring(0, assignmentPos).toLowerCase();\n const value = i.substring(assignmentPos + 1);\n parsed[key] = value;\n });\n\n let endpointPart = parsed[\"endpoint\"];\n if (!endpointPart) throw new TypeError(\"connection string missing endpoint\");\n if (!endpointPart.startsWith(\"http\")) {\n endpointPart = `https://${endpointPart}`;\n }\n const key = parsed[\"accesskey\"];\n if (!key) throw new TypeError(\"connection string missing access key\");\n const credential = new AzureKeyCredential(key);\n const port = parsed[\"port\"];\n const url = new URL(endpointPart);\n url.port = port;\n const endpoint = url.toString();\n url.port = \"\";\n\n return { credential, endpoint };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelineResponse,\n PipelineRequest,\n SendRequest,\n PipelinePolicy\n} from \"@azure/core-rest-pipeline\";\n\nexport const webPubSubReverseProxyPolicyName = \"webPubSubReverseProxyPolicy\";\n\n/**\n * Create an HTTP pipeline policy to use a reverse proxy.\n * This is generally going to be an Azure APIM endpoint.\n * @internal\n */\nexport function webPubSubReverseProxyPolicy(endpoint: string): PipelinePolicy {\n const rpEndpointUrl = new URL(endpoint);\n return {\n name: webPubSubReverseProxyPolicyName,\n sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const parsedUrl = new URL(request.url);\n parsedUrl.host = rpEndpointUrl.host;\n request.url = parsedUrl.toString();\n return next(request);\n }\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommonClientOptions, FullOperationResponse, OperationOptions } from \"@azure/core-client\";\nimport { RestError, RequestBodyType } from \"@azure/core-rest-pipeline\";\nimport { GeneratedClient } from \"./generated/generatedClient\";\nimport { WebPubSubGroup, WebPubSubGroupImpl } from \"./groupClient\";\nimport { AzureKeyCredential, TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { webPubSubKeyCredentialPolicy } from \"./webPubSubCredentialPolicy\";\nimport { createSpan } from \"./tracing\";\nimport { logger } from \"./logger\";\nimport { parseConnectionString } from \"./parseConnectionString\";\nimport jwt from \"jsonwebtoken\";\nimport { getPayloadForMessage } from \"./utils\";\nimport { GeneratedClientOptionalParams } from \"./generated\";\nimport { webPubSubReverseProxyPolicy } from \"./reverseProxyPolicy\";\n\n/**\n * Options for closing a connection to a hub.\n */\nexport interface HubCloseConnectionOptions extends OperationOptions {\n /**\n * Reason the connection is being closed.\n */\n reason?: string;\n}\n\n/**\n * Options for closing all connections to a hub.\n */\nexport interface HubCloseAllConnectionsOptions extends OperationOptions {\n /**\n * Reason the connection is being closed.\n */\n reason?: string;\n}\n\n/**\n * Options for closing all of a user's connections to a hub.\n */\nexport interface HubCloseUserConnectionsOptions extends OperationOptions {\n /**\n * Reason the connection is being closed.\n */\n reason?: string;\n}\n\n/**\n * Options for sending messages to hubs.\n */\nexport interface HubSendToAllOptions extends OperationOptions {\n /**\n * Connection ids to exclude from receiving this message.\n */\n excludedConnections?: string[];\n}\n\n/**\n * Options for sending text messages to hubs.\n */\nexport interface HubSendTextToAllOptions extends HubSendToAllOptions {\n contentType: \"text/plain\";\n}\n\n/**\n * Types which can be serialized and sent as JSON.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type JSONTypes = string | number | boolean | object;\n\n/**\n * Options for constructing a HubAdmin client.\n */\nexport interface WebPubSubServiceClientOptions extends CommonClientOptions {\n /**\n * Reverse proxy endpoint (for example, your Azure API management endpoint)\n */\n reverseProxyEndpoint?: string;\n}\n\n/**\n * Options for checking if a connection exists.\n */\nexport interface HasConnectionOptions extends OperationOptions {}\n\n/**\n * Options for checking if a group exists.\n */\nexport interface HubHasGroupOptions extends OperationOptions {}\n\n/**\n * Options for checking if a user exists.\n */\nexport interface HubHasUserOptions extends OperationOptions {}\n\n/**\n * Options for removing a user from all groups.\n */\nexport interface HubRemoveUserFromAllGroupsOptions extends HubCloseConnectionOptions {}\n\n/**\n * Options for sending a message to a specific connection.\n */\nexport interface HubSendToConnectionOptions extends OperationOptions {}\n\n/**\n * Options for sending a text message to a connection.\n */\nexport interface HubSendTextToConnectionOptions extends HubSendToConnectionOptions {\n contentType: \"text/plain\";\n}\n\n/**\n * Options for sending a message to a user.\n */\nexport interface HubSendToUserOptions extends OperationOptions {}\n\n/**\n * Options for sending a text message to a user.\n */\nexport interface HubSendTextToUserOptions extends HubSendToUserOptions {\n contentType: \"text/plain\";\n}\n\nexport type Permission = \"joinLeaveGroup\" | \"sendToGroup\";\n\n/**\n * Options for grant permissions to a connection\n */\nexport interface HubGrantPermissionOptions extends OperationOptions {\n /**\n * The meaning of the target depends on the specific permission.\n * For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.\n */\n targetName?: string;\n}\n\n/**\n * Options for revoke permissions from a connection\n */\nexport interface HubRevokePermissionOptions extends OperationOptions {\n /**\n * The meaning of the target depends on the specific permission.\n * For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.\n */\n targetName?: string;\n}\n\n/**\n * Options for checking if a connection has the specified permission\n */\nexport interface HubHasPermissionOptions extends OperationOptions {\n /**\n * The meaning of the target depends on the specific permission.\n * For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.\n */\n targetName?: string;\n}\n\n/**\n * Options for generating a token to connect a client to the Azure Web Pubsub service.\n */\nexport interface GenerateClientTokenOptions extends OperationOptions {\n /**\n * The userId for the client.\n */\n userId?: string;\n\n /**\n * The roles that the connection with the generated token will have.\n * Roles give the client initial permissions to leave, join, or publish to groups when using PubSub subprotocol\n * * `webpubsub.joinLeaveGroup`: the client can join or leave any group\n * * `webpubsub.sendToGroup`: the client can send messages to any group\n * * `webpubsub.joinLeaveGroup.<group>`: the client can join or leave group `<group>`\n * * `webpubsub.sendToGroup.<group>`: the client can send messages to group `<group>`\n *\n * {@link https://azure.github.io/azure-webpubsub/references/pubsub-websocket-subprotocol#permissions}\n */\n roles?: string[];\n\n /**\n * Minutes until the token expires.\n */\n expirationTimeInMinutes?: number;\n}\n\n/**\n * A response containing the client token.\n */\nexport interface ClientTokenResponse {\n /**\n * The client token.\n */\n token: string;\n /**\n * The URL client connects to\n */\n baseUrl: string;\n /**\n * The URL client connects to with access_token query string\n */\n url: string;\n}\n\n/**\n * Client for connecting to a Web PubSub hub\n */\nexport class WebPubSubServiceClient {\n private readonly client: GeneratedClient;\n private credential!: AzureKeyCredential | TokenCredential;\n private readonly clientOptions?: WebPubSubServiceClientOptions;\n\n /**\n * The name of the hub this client is connected to\n */\n public readonly hubName: string;\n /**\n * The Web PubSub API version being used by this client\n */\n public readonly apiVersion: string = \"2021-10-01\";\n\n /**\n * The Web PubSub endpoint this client is connected to\n */\n public endpoint!: string;\n\n /**\n * Creates an instance of a WebPubSubServiceClient for sending messages and managing groups, connections, and users.\n *\n * Example usage:\n * ```ts\n * import { WebPubSubServiceClient } from \"@azure/web-pubsub\";\n * const connectionString = process.env['WEB_PUBSUB_CONNECTION_STRING'];\n * const client = new WebPubSubServiceClient(connectionString, 'chat');\n * ```\n *\n * @param connectionString - The connection string\n * @param hubName - The name of the hub to connect to. If omitted, '_default' is used.\n * @param options - Options to configure the http pipeline\n */\n constructor(connectionString: string, hubName: string, options?: WebPubSubServiceClientOptions);\n\n /**\n * Creates an instance of a WebPubSubServiceClient for sending messages and managing groups, connections, and users.\n *\n * Example usage:\n * ```ts\n * import { WebPubSubServiceClient, AzureKeyCredential } from \"@azure/web-pubsub\";\n * const cred = new AzureKeyCredential(\"<your web pubsub api key>\");\n * const endpoint = \"https://xxxx.webpubsubdev.azure.com\"\n * const client = new WebPubSubServiceClient(endpoint, cred, 'chat');\n * ```\n *\n * @param endpoint - The endpoint to connect to\n * @param credential - An AzureKeyCredential holding your service key\n * @param hubName - The name of the hub to connect to.\n * @param options - Options to configure the http pipeline\n */\n constructor(\n endpoint: string,\n credential: AzureKeyCredential | TokenCredential,\n hubName: string,\n options?: WebPubSubServiceClientOptions\n );\n constructor(\n endpointOrConnectionString: string,\n credsOrHubName?: AzureKeyCredential | TokenCredential | string,\n hubNameOrOpts?: string | WebPubSubServiceClientOptions,\n opts?: WebPubSubServiceClientOptions\n ) {\n // unpack constructor arguments\n if (typeof credsOrHubName === \"object\") {\n this.endpoint = endpointOrConnectionString;\n this.hubName = hubNameOrOpts as string;\n this.clientOptions = opts;\n this.credential = credsOrHubName;\n } else {\n const parsedCs = parseConnectionString(endpointOrConnectionString);\n this.endpoint = parsedCs.endpoint;\n this.credential = parsedCs.credential;\n this.hubName = credsOrHubName as string;\n this.clientOptions = hubNameOrOpts as WebPubSubServiceClientOptions;\n }\n\n const internalPipelineOptions: GeneratedClientOptionalParams = {\n ...this.clientOptions,\n ...{\n apiVersion: this.apiVersion,\n loggingOptions: {\n logger: logger.info\n }\n },\n ...(isTokenCredential(this.credential)\n ? {\n credential: this.credential,\n credentialScopes: [\"https://webpubsub.azure.com/.default\"]\n }\n : {})\n };\n\n this.client = new GeneratedClient(this.endpoint, internalPipelineOptions);\n\n if (!isTokenCredential(this.credential)) {\n this.client.pipeline.addPolicy(webPubSubKeyCredentialPolicy(this.credential));\n }\n\n if (this.clientOptions?.reverseProxyEndpoint) {\n this.client.pipeline.addPolicy(\n webPubSubReverseProxyPolicy(this.clientOptions?.reverseProxyEndpoint)\n );\n }\n }\n\n /**\n * Get a client for a group\n * @param groupName - The name of the group to connect to.\n */\n public group(groupName: string): WebPubSubGroup {\n return new WebPubSubGroupImpl(this.client, this.hubName, groupName);\n }\n\n /**\n * Broadcast a text message to all connections on this hub.\n *\n * @param message - The text message to send\n * @param options - Additional options\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public async sendToAll(message: string, options: HubSendTextToAllOptions): Promise<void>;\n /**\n * Broadcast a JSON message to all connections on this hub.\n *\n * @param message - The JSON message to send\n * @param options - Additional options\n */\n public async sendToAll(message: JSONTypes, options?: HubSendToAllOptions): Promise<void>;\n /**\n * Broadcast a binary message to all connections on this hub.\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n public async sendToAll(message: RequestBodyType, options?: HubSendToAllOptions): Promise<void>;\n\n public async sendToAll(\n message: RequestBodyType | JSONTypes,\n options: HubSendToAllOptions | HubSendTextToAllOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-hub-sendToAll\", options);\n\n const { contentType, payload } = getPayloadForMessage(message, updatedOptions);\n\n try {\n return await this.client.webPubSub.sendToAll(\n this.hubName,\n contentType,\n payload as any,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Send a text message to a specific user\n *\n * @param username - User name to send to\n * @param message - The text message to send\n * @param options - Additional options\n */\n public async sendToUser(\n username: string,\n message: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: HubSendTextToUserOptions\n ): Promise<void>;\n\n /**\n * Send a JSON message to a specific user\n *\n * @param username - User name to send to\n * @param message - The josn message to send\n * @param options - Additional options\n */\n public async sendToUser(\n username: string,\n message: JSONTypes,\n options?: HubSendToUserOptions\n ): Promise<void>;\n\n /**\n * Send a binary message to a specific user\n *\n * @param username - The user name to send to\n * @param message - The binary message to send\n * @param options - Additional options\n */\n public async sendToUser(\n username: string,\n message: RequestBodyType,\n options?: HubSendToUserOptions | HubSendTextToUserOptions\n ): Promise<void>;\n public async sendToUser(\n username: string,\n message: RequestBodyType | JSONTypes,\n options: HubSendToUserOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-hub-sendToUser\", options);\n\n const { contentType, payload } = getPayloadForMessage(message, updatedOptions);\n try {\n return await this.client.webPubSub.sendToUser(\n this.hubName,\n username,\n contentType,\n payload as any,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Send a text message to a specific connection\n *\n * @param connectionId - Connection id to send to\n * @param message - The text message\n * @param options - Additional options\n */\n public async sendToConnection(\n connectionId: string,\n message: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: HubSendTextToConnectionOptions\n ): Promise<void>;\n\n /**\n * Send a binary message to a specific connection\n *\n * @param connectionId - Connection id to send to\n * @param message - The JSON message\n * @param options - Additional options\n */\n public async sendToConnection(\n connectionId: string,\n message: JSONTypes,\n options?: HubSendToConnectionOptions\n ): Promise<void>;\n\n /**\n * Send a binary message to a specific connection\n *\n * @param connectionId - Connection id to send to\n * @param message - The binary message\n * @param options - Additional options\n */\n public async sendToConnection(\n connectionId: string,\n message: RequestBodyType,\n options?: HubSendToConnectionOptions | HubSendTextToConnectionOptions\n ): Promise<void>;\n public async sendToConnection(\n connectionId: string,\n message: RequestBodyType | JSONTypes,\n options: HubSendToConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-sendToConnection\",\n options\n );\n const { contentType, payload } = getPayloadForMessage(message, updatedOptions);\n\n try {\n return await this.client.webPubSub.sendToConnection(\n this.hubName,\n connectionId,\n contentType,\n payload as any,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Check if a specific connection is connected to this hub\n *\n * @param connectionId - Connection id to check\n * @param options - Additional options\n */\n public async connectionExists(\n connectionId: string,\n options: HasConnectionOptions = {}\n ): Promise<boolean> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-hasConnection\",\n options\n );\n\n let response: FullOperationResponse | undefined;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n response = rawResponse;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n await this.client.webPubSub.connectionExists(this.hubName, connectionId, {\n ...updatedOptions,\n onResponse\n });\n\n if (response!.status === 200) {\n return true;\n } else if (response!.status === 404) {\n return false;\n } else {\n // this is sad - wish this was handled by autorest.\n throw new RestError(response!.bodyAsText!, {\n statusCode: response?.status,\n request: response?.request,\n response: response\n });\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Close a specific connection to this hub\n *\n * @param connectionId - Connection id to close\n * @param options - Additional options\n */\n public async closeConnection(\n connectionId: string,\n options: HubCloseConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-closeConnection\",\n options\n );\n\n try {\n return await this.client.webPubSub.closeConnection(\n this.hubName,\n connectionId,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Close all connections to this hub\n *\n * @param options - Additional options\n */\n public async closeAllConnections(options: HubCloseAllConnectionsOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-closeAllConnections\",\n options\n );\n\n try {\n return await this.client.webPubSub.closeAllConnections(this.hubName, updatedOptions);\n } finally {\n span.end();\n }\n }\n\n /**\n * Close all connections with the given user id\n *\n * @param user - User id to close\n * @param options - Additional options\n */\n public async closeUserConnections(\n userId: string,\n options: HubCloseUserConnectionsOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-closeUserConnections\",\n options\n );\n\n try {\n return await this.client.webPubSub.closeUserConnections(this.hubName, userId, updatedOptions);\n } finally {\n span.end();\n }\n }\n\n /**\n * Remove a specific user from all groups they are joined to\n * @param userId - The user id to remove from all groups\n * @param options - Additional options\n */\n public async removeUserFromAllGroups(\n userId: string,\n options: HubCloseConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-removeUserFromAllGroups\",\n options\n );\n\n try {\n await this.client.webPubSub.removeUserFromAllGroups(this.hubName, userId, updatedOptions);\n } finally {\n span.end();\n }\n }\n\n /**\n * Check if a particular group exists (i.e. has active connections).\n *\n * @param groupName - The group name to check for\n * @param options - Additional options\n */\n public async groupExists(groupName: string, options: HubHasGroupOptions = {}): Promise<boolean> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-hub-hasGroup\", options);\n let response: FullOperationResponse | undefined;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n response = rawResponse;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n await this.client.webPubSub.groupExists(this.hubName, groupName, {\n ...updatedOptions,\n onResponse\n });\n\n if (response!.status === 200) {\n return true;\n } else if (response!.status === 404) {\n return false;\n } else {\n throw new RestError(response!.bodyAsText!, {\n statusCode: response?.status,\n request: response?.request,\n response: response\n });\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Check if a particular user is connected to this hub.\n *\n * @param username - The user name to check for\n * @param options - Additional options\n */\n public async userExists(username: string, options: HubHasUserOptions = {}): Promise<boolean> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-hub-hasUser\", options);\n\n let response: FullOperationResponse | undefined;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n response = rawResponse;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n await this.client.webPubSub.userExists(this.hubName, username, {\n ...updatedOptions,\n onResponse\n });\n\n if (response!.status === 200) {\n return true;\n } else if (response!.status === 404) {\n return false;\n } else {\n // this is sad - wish this was handled by autorest.\n throw new RestError(response!.bodyAsText!, {\n statusCode: response?.status,\n request: response?.request,\n response: response\n });\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Grant permissions to a connection\n *\n * @param connectionId - The connection id to grant permissions to\n * @param Permission - The permission to grant\n * @param options - Additional options\n */\n public async grantPermission(\n connectionId: string,\n permission: Permission,\n options: HubGrantPermissionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-grantPermission\",\n options\n );\n\n try {\n return await this.client.webPubSub.grantPermission(\n this.hubName,\n permission,\n connectionId,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Revoke permissions from a connection\n *\n * @param connectionId - The connection id to revoke permissions from\n * @param Permission - The permission to revoke\n * @param options - Additional options\n */\n public async revokePermission(\n connectionId: string,\n permission: Permission,\n options: HubRevokePermissionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-revokePermission\",\n options\n );\n\n try {\n return await this.client.webPubSub.revokePermission(\n this.hubName,\n permission,\n connectionId,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Check if the connection has the specified permission\n *\n * @param connectionId - The connection id to check permission\n * @param Permission - The permission to check\n * @param options - Additional options\n */\n public async hasPermission(\n connectionId: string,\n permission: Permission,\n options: HubHasPermissionOptions = {}\n ): Promise<boolean> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-hasPermission\",\n options\n );\n let response: FullOperationResponse | undefined;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n response = rawResponse;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n await this.client.webPubSub.checkPermission(this.hubName, permission, connectionId, {\n ...updatedOptions,\n onResponse\n });\n\n if (response!.status === 200) {\n return true;\n } else if (response!.status === 404) {\n return false;\n } else {\n // this is sad - wish this was handled by autorest.\n throw new RestError(response!.bodyAsText!, {\n statusCode: response?.status,\n request: response?.request,\n response: response\n });\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Generate a token for a client to connect to the Azure Web PubSub service.\n *\n * @param options - Additional options\n */\n public async getClientAccessToken(\n options: GenerateClientTokenOptions = {}\n ): Promise<ClientTokenResponse> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-generateClientToken\",\n options\n );\n\n try {\n const endpoint = this.endpoint.endsWith(\"/\") ? this.endpoint : this.endpoint + \"/\";\n const clientEndpoint = endpoint.replace(/(http)(s?:\\/\\/)/gi, \"ws$2\");\n const baseUrl = `${clientEndpoint}client/hubs/${this.hubName}`;\n\n let token: string;\n if (isTokenCredential(this.credential)) {\n const response = await this.client.webPubSub.generateClientToken(\n this.hubName,\n updatedOptions\n );\n token = response.token!;\n } else {\n const key = this.credential.key;\n const audience = `${endpoint}client/hubs/${this.hubName}`;\n const payload = { role: options?.roles };\n const signOptions: jwt.SignOptions = {\n audience: audience,\n expiresIn:\n options?.expirationTimeInMinutes === undefined\n ? \"1h\"\n : `${options.expirationTimeInMinutes}m`,\n algorithm: \"HS256\"\n };\n if (options?.userId) {\n signOptions.subject = options?.userId;\n }\n token = jwt.sign(payload, key, signOptions);\n }\n\n return {\n token,\n baseUrl,\n url: `${baseUrl}?access_token=${token}`\n };\n } finally {\n span.end();\n }\n }\n}\n"],"names":["coreClient.createSerializer","Parameters.apiVersion","Parameters.endpoint","serializer","Mappers.ClientTokenResponse","Mappers.ErrorDetail","Mappers.WebPubSubGenerateClientTokenExceptionHeaders","Parameters.userId","Parameters.roles","Parameters.expirationTimeInMinutes","Parameters.hub","Parameters.accept","Mappers.WebPubSubCloseAllConnectionsExceptionHeaders","Parameters.excluded","Parameters.reason","Mappers.WebPubSubSendToAllExceptionHeaders","Parameters.message","Parameters.excludedConnections","Parameters.contentType","Parameters.accept1","Parameters.message1","Parameters.contentType1","Parameters.accept2","Mappers.WebPubSubConnectionExistsExceptionHeaders","Parameters.connectionId","Mappers.WebPubSubCloseConnectionExceptionHeaders","Mappers.WebPubSubSendToConnectionExceptionHeaders","Mappers.WebPubSubGroupExistsExceptionHeaders","Parameters.group","Mappers.WebPubSubCloseGroupConnectionsExceptionHeaders","Mappers.WebPubSubSendToGroupExceptionHeaders","Mappers.WebPubSubAddConnectionToGroupExceptionHeaders","Mappers.WebPubSubRemoveConnectionFromGroupExceptionHeaders","Mappers.WebPubSubUserExistsExceptionHeaders","Parameters.userId1","Mappers.WebPubSubCloseUserConnectionsExceptionHeaders","Mappers.WebPubSubSendToUserExceptionHeaders","Mappers.WebPubSubAddUserToGroupExceptionHeaders","Mappers.WebPubSubRemoveUserFromGroupExceptionHeaders","Mappers.WebPubSubRemoveUserFromAllGroupsExceptionHeaders","Mappers.WebPubSubGrantPermissionExceptionHeaders","Parameters.targetName","Parameters.permission","Mappers.WebPubSubRevokePermissionExceptionHeaders","Mappers.WebPubSubCheckPermissionExceptionHeaders","coreClient.ServiceClient","createSpanFunction","RestError","createClientLogger","AzureKeyCredential","url","URL","isTokenCredential"],"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;AAUO,MAAM,mBAAmB,GAA+B;IAC7D,IAAI,EAAE;QACJ,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,qBAAqB;QAChC,eAAe,EAAE;YACf,KAAK,EAAE;gBACL,cAAc,EAAE,OAAO;gBACvB,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;KACF;CACF,CAAC;AAEK,MAAM,WAAW,GAA+B;IACrD,IAAI,EAAE;QACJ,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,aAAa;QACxB,eAAe,EAAE;YACf,IAAI,EAAE;gBACJ,cAAc,EAAE,MAAM;gBACtB,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,OAAO,EAAE;gBACP,cAAc,EAAE,SAAS;gBACzB,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,MAAM,EAAE;gBACN,cAAc,EAAE,QAAQ;gBACxB,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,OAAO,EAAE;gBACP,cAAc,EAAE,SAAS;gBACzB,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU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AG,QAAQ,CAAC,KAAM,CAAC;aACzB;iBAAM;gBACL,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;gBAChC,MAAM,QAAQ,GAAG,GAAG,QAAQ,eAAe,IAAI,CAAC,OAAO,EAAE,CAAC;gBAC1D,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EAAE,CAAC;gBACzC,MAAM,WAAW,GAAoB;oBACnC,QAAQ,EAAE,QAAQ;oBAClB,SAAS,EACP,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,uBAAuB,MAAK,SAAS;0BAC1C,IAAI;0BACJ,GAAG,OAAO,CAAC,uBAAuB,GAAG;oBAC3C,SAAS,EAAE,OAAO;iBACnB,CAAC;gBACF,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE;oBACnB,WAAW,CAAC,OAAO,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC;iBACvC;gBACD,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC;aAC7C;YAED,OAAO;gBACL,KAAK;gBACL,OAAO;gBACP,GAAG,EAAE,GAAG,OAAO,iBAAiB,KAAK,EAAE;aACxC,CAAC;SACH;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;KACF;CACF;;;;;;;;;;"}
@@ -69,7 +69,7 @@ export class WebPubSubGroupImpl {
69
69
  * @param options - Additional options
70
70
  */
71
71
  async closeAllConnections(options = {}) {
72
- const { span, updatedOptions } = createSpan("WebPubSubServiceClient-hub-closeAllConnections", options);
72
+ const { span, updatedOptions } = createSpan("WebPubSubServiceClient-group-closeAllConnections", options);
73
73
  try {
74
74
  return await this.client.webPubSub.closeGroupConnections(this.hubName, this.groupName, updatedOptions);
75
75
  }
@@ -1 +1 @@
1
- {"version":3,"file":"groupClient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,CAAC;SACH;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;IACH,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,UAAU,CAAC,QAAgB,EAAE,UAAkC,EAAE;QAC5E,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC,yCAAyC,EAAE,OAAO,CAAC,CAAC;QAEhG,IAAI;YACF,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,mBAAmB,CAC7C,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,SAAS,EACd,QAAQ,EACR,cAAc,CACf,CAAC;SACH;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;IACH,CAAC;IAwBM,KAAK,CAAC,SAAS,CACpB,OAAoC,EACpC,UAA6D,EAAE;QAE/D,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC,wCAAwC,EAAE,OAAO,CAAC,CAAC;QAE/F,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,oBAAoB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAE/E,IAAI;YACF,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CACrC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,SAAS,EACd,WAAW,EACX,OAAc,EACd,cAAc,CACf,CAAC;SACH;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommonClientOptions, FullOperationResponse, OperationOptions } from \"@azure/core-client\";\nimport { RestError, RequestBodyType } from \"@azure/core-rest-pipeline\";\nimport { GeneratedClient } from \"./generated/generatedClient\";\nimport { createSpan } from \"./tracing\";\nimport { getPayloadForMessage } from \"./utils\";\nimport { JSONTypes } from \"./hubClient\";\n\n/**\n * Options for constructing a GroupAdmin client.\n */\nexport interface GroupAdminClientOptions extends CommonClientOptions {}\n\n/**\n * Options for adding a connection to a group.\n */\nexport interface GroupAddConnectionOptions extends OperationOptions {}\n\n/**\n * Options for adding a user to a group.\n */\nexport interface GroupAddUserOptions extends OperationOptions {}\n\n/**\n * Options for checking if a user is in a group\n */\nexport interface GroupHasUserOptions extends OperationOptions {}\n\n/**\n * Options for removing a user from a group\n */\nexport interface GroupRemoveUserOptions extends OperationOptions {}\n\n/**\n * Options for removing a connection from a group\n */\nexport interface GroupRemoveConnectionOptions extends OperationOptions {}\n\n/**\n * Options for sending messages to a group.\n */\nexport interface GroupSendToAllOptions extends OperationOptions {\n /**\n * Connection ids to exclude from receiving this message.\n */\n excludedConnections?: string[];\n}\n\n/**\n * Options for sending text messages to a group..\n */\nexport interface GroupSendTextToAllOptions extends OperationOptions {\n /**\n * Connection ids to exclude from receiving this message.\n */\n excludedConnections?: string[];\n contentType: \"text/plain\";\n}\n\n/**\n * Options for closing all connections to a group.\n */\nexport interface GroupCloseAllConnectionsOptions extends OperationOptions {\n /**\n * Reason the connection is being closed.\n */\n reason?: string;\n}\n\nexport interface WebPubSubGroup {\n /**\n * The name of this group\n */\n readonly groupName: string;\n\n /**\n * The name of the hub this group belongs to\n */\n readonly hubName: string;\n\n /**\n * The Web PubSub API version being used by this client\n */\n readonly apiVersion: string;\n\n /**\n * The Web PubSub endpoint this client is connected to\n */\n readonly endpoint: string;\n\n /**\n * Add a specific connection to this group\n *\n * @param connectionId - The connection id to add to this group\n * @param options - Additional options\n */\n addConnection(connectionId: string, options?: GroupAddConnectionOptions): Promise<void>;\n\n /**\n * Remove a specific connection from this group\n *\n * @param connectionId - The connection id to remove from this group\n * @param options - Additional options\n */\n removeConnection(connectionId: string, options?: GroupRemoveConnectionOptions): Promise<void>;\n\n /**\n * Add a user to this group\n *\n * @param username - The user name to add\n * @param options - Additional options\n */\n addUser(username: string, options?: GroupAddUserOptions): Promise<void>;\n\n /**\n * Remove a user from this group\n *\n * @param username - The user name to remove\n * @param options - Additional options\n */\n removeUser(username: string, options?: GroupRemoveUserOptions): Promise<void>;\n\n /**\n * Send a text message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n sendToAll(message: string, options: GroupSendTextToAllOptions): Promise<void>;\n /**\n * Send a json message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n sendToAll(message: JSONTypes, options?: GroupSendToAllOptions): Promise<void>;\n /**\n * Send a binary message to every connection in this group\n *\n * @param message - The binary message to send\n * @param options - Additional options\n */\n sendToAll(message: RequestBodyType, options?: GroupSendToAllOptions): Promise<void>;\n}\n\n/**\n * @hidden\n */\nexport class WebPubSubGroupImpl implements WebPubSubGroup {\n private client!: GeneratedClient;\n\n /**\n * The name of this group\n */\n public readonly groupName: string;\n\n /**\n * The name of the hub this group belongs to\n */\n public readonly hubName: string;\n\n /**\n * The Web PubSub API version being used by this client\n */\n public readonly apiVersion: string = \"2020-10-01\";\n\n /**\n * The Web PubSub endpoint this client is connected to\n */\n public endpoint!: string;\n\n /**\n * @internal\n */\n constructor(client: GeneratedClient, hubName: string, groupName: string) {\n this.client = client;\n this.groupName = groupName;\n this.hubName = hubName;\n }\n /**\n * Add a specific connection to this group\n *\n * @param connectionId - The connection id to add to this group\n * @param options - Additional options\n */\n public async addConnection(\n connectionId: string,\n options: GroupAddConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-group-addConnection\",\n options\n );\n\n let response: FullOperationResponse | undefined;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n response = rawResponse;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n await this.client.webPubSub.addConnectionToGroup(this.hubName, this.groupName, connectionId, {\n ...updatedOptions,\n onResponse\n });\n\n if (response!.status === 404) {\n throw new RestError(`Connection id '${connectionId}' doesn't exist`, {\n statusCode: response?.status,\n request: response?.request,\n response: response\n });\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Remove a specific connection from this group\n *\n * @param connectionId - The connection id to remove from this group\n * @param options - Additional options\n */\n public async removeConnection(\n connectionId: string,\n options: GroupRemoveConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-group-removeConnection\",\n options\n );\n\n try {\n await this.client.webPubSub.removeConnectionFromGroup(\n this.hubName,\n this.groupName,\n connectionId,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Close all connections to this group\n *\n * @param options - Additional options\n */\n public async closeAllConnections(options: GroupCloseAllConnectionsOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-hub-closeAllConnections\",\n options\n );\n\n try {\n return await this.client.webPubSub.closeGroupConnections(\n this.hubName,\n this.groupName,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n /**\n * Add a user to this group\n *\n * @param username - The user name to add\n * @param options - Additional options\n */\n public async addUser(username: string, options: GroupAddUserOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-group-addUser\", options);\n\n try {\n await this.client.webPubSub.addUserToGroup(\n this.hubName,\n this.groupName,\n username,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Remove a user from this group\n *\n * @param username - The user name to remove\n * @param options - Additional options\n */\n public async removeUser(username: string, options: GroupRemoveUserOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-group-removeUser\", options);\n\n try {\n await this.client.webPubSub.removeUserFromGroup(\n this.hubName,\n this.groupName,\n username,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Send a text message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n public async sendToAll(message: string, options: GroupSendTextToAllOptions): Promise<void>;\n /**\n * Send a json message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n public async sendToAll(message: JSONTypes, options?: GroupSendToAllOptions): Promise<void>;\n /**\n * Send a binary message to every connection in this group\n *\n * @param message - The binary message to send\n * @param options - Additional options\n */\n public async sendToAll(message: RequestBodyType, options?: GroupSendToAllOptions): Promise<void>;\n\n public async sendToAll(\n message: JSONTypes | RequestBodyType,\n options: GroupSendToAllOptions | GroupSendTextToAllOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-group-sendToAll\", options);\n\n const { contentType, payload } = getPayloadForMessage(message, updatedOptions);\n\n try {\n await this.client.webPubSub.sendToGroup(\n this.hubName,\n this.groupName,\n contentType,\n payload as any,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n}\n"]}
1
+ {"version":3,"file":"groupClient.js","sourceRoot":"","sources":["../../src/groupClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAmB,MAAM,2BAA2B,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAmJ/C;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAuB7B;;OAEG;IACH,YAAY,MAAuB,EAAE,OAAe,EAAE,SAAiB;QAbvE;;WAEG;QACa,eAAU,GAAW,YAAY,CAAC;QAWhD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACD;;;;;OAKG;IACI,KAAK,CAAC,aAAa,CACxB,YAAoB,EACpB,UAAqC,EAAE;QAEvC,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,UAAU,CACzC,4CAA4C,EAC5C,OAAO,CACR,CAAC;QAEF,IAAI,QAA2C,CAAC;QAChD,SAAS,UAAU,CAAC,WAAkC,EAAE,YAAqB;YAC3E,QAAQ,GAAG,WAAW,CAAC;YACvB,IAAI,cAAc,CAAC,UAAU,EAAE;gBAC7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ACX,OAAc,EACd,cAAc,CACf,CAAC;SACH;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommonClientOptions, FullOperationResponse, OperationOptions } from \"@azure/core-client\";\nimport { RestError, RequestBodyType } from \"@azure/core-rest-pipeline\";\nimport { GeneratedClient } from \"./generated/generatedClient\";\nimport { createSpan } from \"./tracing\";\nimport { getPayloadForMessage } from \"./utils\";\nimport { JSONTypes } from \"./hubClient\";\n\n/**\n * Options for constructing a GroupAdmin client.\n */\nexport interface GroupAdminClientOptions extends CommonClientOptions {}\n\n/**\n * Options for adding a connection to a group.\n */\nexport interface GroupAddConnectionOptions extends OperationOptions {}\n\n/**\n * Options for adding a user to a group.\n */\nexport interface GroupAddUserOptions extends OperationOptions {}\n\n/**\n * Options for checking if a user is in a group\n */\nexport interface GroupHasUserOptions extends OperationOptions {}\n\n/**\n * Options for removing a user from a group\n */\nexport interface GroupRemoveUserOptions extends OperationOptions {}\n\n/**\n * Options for removing a connection from a group\n */\nexport interface GroupRemoveConnectionOptions extends OperationOptions {}\n\n/**\n * Options for sending messages to a group.\n */\nexport interface GroupSendToAllOptions extends OperationOptions {\n /**\n * Connection ids to exclude from receiving this message.\n */\n excludedConnections?: string[];\n}\n\n/**\n * Options for sending text messages to a group..\n */\nexport interface GroupSendTextToAllOptions extends OperationOptions {\n /**\n * Connection ids to exclude from receiving this message.\n */\n excludedConnections?: string[];\n contentType: \"text/plain\";\n}\n\n/**\n * Options for closing all connections to a group.\n */\nexport interface GroupCloseAllConnectionsOptions extends OperationOptions {\n /**\n * Reason the connection is being closed.\n */\n reason?: string;\n}\n\nexport interface WebPubSubGroup {\n /**\n * The name of this group\n */\n readonly groupName: string;\n\n /**\n * The name of the hub this group belongs to\n */\n readonly hubName: string;\n\n /**\n * The Web PubSub API version being used by this client\n */\n readonly apiVersion: string;\n\n /**\n * The Web PubSub endpoint this client is connected to\n */\n readonly endpoint: string;\n\n /**\n * Add a specific connection to this group\n *\n * @param connectionId - The connection id to add to this group\n * @param options - Additional options\n */\n addConnection(connectionId: string, options?: GroupAddConnectionOptions): Promise<void>;\n\n /**\n * Remove a specific connection from this group\n *\n * @param connectionId - The connection id to remove from this group\n * @param options - Additional options\n */\n removeConnection(connectionId: string, options?: GroupRemoveConnectionOptions): Promise<void>;\n\n /**\n * Close all connections to the group\n *\n * @param options - Additional options\n */\n closeAllConnections(options?: GroupCloseAllConnectionsOptions): Promise<void>;\n\n /**\n * Add a user to this group\n *\n * @param username - The user name to add\n * @param options - Additional options\n */\n addUser(username: string, options?: GroupAddUserOptions): Promise<void>;\n\n /**\n * Remove a user from this group\n *\n * @param username - The user name to remove\n * @param options - Additional options\n */\n removeUser(username: string, options?: GroupRemoveUserOptions): Promise<void>;\n\n /**\n * Send a text message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n sendToAll(message: string, options: GroupSendTextToAllOptions): Promise<void>;\n /**\n * Send a json message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n sendToAll(message: JSONTypes, options?: GroupSendToAllOptions): Promise<void>;\n /**\n * Send a binary message to every connection in this group\n *\n * @param message - The binary message to send\n * @param options - Additional options\n */\n sendToAll(message: RequestBodyType, options?: GroupSendToAllOptions): Promise<void>;\n}\n\n/**\n * @hidden\n */\nexport class WebPubSubGroupImpl implements WebPubSubGroup {\n private client!: GeneratedClient;\n\n /**\n * The name of this group\n */\n public readonly groupName: string;\n\n /**\n * The name of the hub this group belongs to\n */\n public readonly hubName: string;\n\n /**\n * The Web PubSub API version being used by this client\n */\n public readonly apiVersion: string = \"2020-10-01\";\n\n /**\n * The Web PubSub endpoint this client is connected to\n */\n public endpoint!: string;\n\n /**\n * @internal\n */\n constructor(client: GeneratedClient, hubName: string, groupName: string) {\n this.client = client;\n this.groupName = groupName;\n this.hubName = hubName;\n }\n /**\n * Add a specific connection to this group\n *\n * @param connectionId - The connection id to add to this group\n * @param options - Additional options\n */\n public async addConnection(\n connectionId: string,\n options: GroupAddConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-group-addConnection\",\n options\n );\n\n let response: FullOperationResponse | undefined;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n response = rawResponse;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n await this.client.webPubSub.addConnectionToGroup(this.hubName, this.groupName, connectionId, {\n ...updatedOptions,\n onResponse\n });\n\n if (response!.status === 404) {\n throw new RestError(`Connection id '${connectionId}' doesn't exist`, {\n statusCode: response?.status,\n request: response?.request,\n response: response\n });\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Remove a specific connection from this group\n *\n * @param connectionId - The connection id to remove from this group\n * @param options - Additional options\n */\n public async removeConnection(\n connectionId: string,\n options: GroupRemoveConnectionOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-group-removeConnection\",\n options\n );\n\n try {\n await this.client.webPubSub.removeConnectionFromGroup(\n this.hubName,\n this.groupName,\n connectionId,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Close all connections to this group\n *\n * @param options - Additional options\n */\n public async closeAllConnections(options: GroupCloseAllConnectionsOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"WebPubSubServiceClient-group-closeAllConnections\",\n options\n );\n\n try {\n return await this.client.webPubSub.closeGroupConnections(\n this.hubName,\n this.groupName,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n /**\n * Add a user to this group\n *\n * @param username - The user name to add\n * @param options - Additional options\n */\n public async addUser(username: string, options: GroupAddUserOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-group-addUser\", options);\n\n try {\n await this.client.webPubSub.addUserToGroup(\n this.hubName,\n this.groupName,\n username,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Remove a user from this group\n *\n * @param username - The user name to remove\n * @param options - Additional options\n */\n public async removeUser(username: string, options: GroupRemoveUserOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-group-removeUser\", options);\n\n try {\n await this.client.webPubSub.removeUserFromGroup(\n this.hubName,\n this.groupName,\n username,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n\n /**\n * Send a text message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n public async sendToAll(message: string, options: GroupSendTextToAllOptions): Promise<void>;\n /**\n * Send a json message to every connection in this group\n *\n * @param message - The message to send\n * @param options - Additional options\n */\n public async sendToAll(message: JSONTypes, options?: GroupSendToAllOptions): Promise<void>;\n /**\n * Send a binary message to every connection in this group\n *\n * @param message - The binary message to send\n * @param options - Additional options\n */\n public async sendToAll(message: RequestBodyType, options?: GroupSendToAllOptions): Promise<void>;\n\n public async sendToAll(\n message: JSONTypes | RequestBodyType,\n options: GroupSendToAllOptions | GroupSendTextToAllOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"WebPubSubServiceClient-group-sendToAll\", options);\n\n const { contentType, payload } = getPayloadForMessage(message, updatedOptions);\n\n try {\n await this.client.webPubSub.sendToGroup(\n this.hubName,\n this.groupName,\n contentType,\n payload as any,\n updatedOptions\n );\n } finally {\n span.end();\n }\n }\n}\n"]}
@@ -0,0 +1,128 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ /* eslint-disable no-invalid-this */
4
+ import { WebPubSubServiceClient } from "../src/index";
5
+ import { env, isLiveMode } from "@azure-tools/test-recorder";
6
+ import { assert } from "chai";
7
+ import ws from "ws";
8
+ function defer() {
9
+ let actualResolve;
10
+ let actualReject;
11
+ const promise = new Promise((resolve, reject) => {
12
+ actualResolve = resolve;
13
+ actualReject = reject;
14
+ });
15
+ return {
16
+ promise,
17
+ resolve: actualResolve,
18
+ reject: actualReject
19
+ };
20
+ }
21
+ class SimpleWebSocketFrame {
22
+ constructor(data, isBinary) {
23
+ this.data = data;
24
+ this.isBinary = isBinary;
25
+ if (!isBinary) {
26
+ this.dataAsString = data.toString();
27
+ }
28
+ }
29
+ isEndSignal() {
30
+ return (this.isBinary &&
31
+ this.data instanceof Buffer &&
32
+ this.data[0] === 5 &&
33
+ this.data[1] === 1 &&
34
+ this.data[2] === 1);
35
+ }
36
+ }
37
+ class PubSubWebSocketFrame {
38
+ constructor(data, isBinary) {
39
+ assert.isFalse(isBinary);
40
+ this.dataAsString = data.toString();
41
+ this.message = JSON.parse(this.dataAsString);
42
+ }
43
+ isEndSignal() {
44
+ return this.message.dataType === "binary" && this.message.data === "BQEB";
45
+ }
46
+ }
47
+ function getEndSignal() {
48
+ // magic number 511
49
+ const payload = new Uint8Array(3);
50
+ payload[0] = 5;
51
+ payload[1] = 1;
52
+ payload[2] = 1;
53
+ return payload;
54
+ }
55
+ describe("ServiceClient to manage the connected WebSocket connections", function () {
56
+ it("Simple clients can receive expected messages with different content types", async function () {
57
+ if (!isLiveMode())
58
+ this.skip();
59
+ const hub = "SimpleClientCanReceiveMessage";
60
+ const messages = [];
61
+ // Get token
62
+ const serviceClient = new WebPubSubServiceClient(env.WPS_CONNECTION_STRING, hub);
63
+ const token = await serviceClient.getClientAccessToken();
64
+ const endSignal = defer();
65
+ // Start simple WebSocket connections
66
+ const client = new ws.WebSocket(token.url);
67
+ client.on("message", (data, isBinary) => {
68
+ const frame = new SimpleWebSocketFrame(data, isBinary);
69
+ if (frame.isEndSignal()) {
70
+ endSignal.resolve();
71
+ client.close();
72
+ }
73
+ else {
74
+ messages.push(frame);
75
+ }
76
+ });
77
+ client.on("open", async () => {
78
+ // send to all
79
+ // Send a JSON message
80
+ await serviceClient.sendToAll({ message: "Hello world!" });
81
+ // Send a plain text message
82
+ await serviceClient.sendToAll("Hi there!", { contentType: "text/plain" });
83
+ // Send the binary end signal message
84
+ await serviceClient.sendToAll(getEndSignal());
85
+ });
86
+ await endSignal.promise;
87
+ assert.equal(messages.length, 2);
88
+ assert.equal(messages[0].dataAsString, '{"message":"Hello world!"}');
89
+ assert.equal(messages[1].dataAsString, "Hi there!");
90
+ });
91
+ it("Subprotocol clients can receive expected messages with different content types", async function () {
92
+ if (!isLiveMode())
93
+ this.skip();
94
+ const hub = "PubSubClientCanReceiveMessage";
95
+ const messages = [];
96
+ // Get token
97
+ const serviceClient = new WebPubSubServiceClient(env.WPS_CONNECTION_STRING, hub);
98
+ const token = await serviceClient.getClientAccessToken();
99
+ const endSignal = defer();
100
+ // Start simple WebSocket connections
101
+ const client = new ws.WebSocket(token.url, "json.webpubsub.azure.v1");
102
+ client.on("message", (data, isBinary) => {
103
+ const frame = new PubSubWebSocketFrame(data, isBinary);
104
+ if (frame.isEndSignal()) {
105
+ endSignal.resolve();
106
+ client.close();
107
+ }
108
+ else {
109
+ messages.push(frame);
110
+ }
111
+ });
112
+ client.on("open", async () => {
113
+ // send to all
114
+ // Send a JSON message
115
+ await serviceClient.sendToAll({ message: "Hello world!" });
116
+ // Send a plain text message
117
+ await serviceClient.sendToAll("Hi there!", { contentType: "text/plain" });
118
+ // Send the binary end signal message
119
+ await serviceClient.sendToAll(getEndSignal());
120
+ });
121
+ await endSignal.promise;
122
+ assert.equal(messages.length, 3);
123
+ assert.equal(messages[0].message.event, "connected");
124
+ assert.equal(messages[1].dataAsString, '{"type":"message","from":"server","dataType":"json","data":{"message":"Hello world!"}}');
125
+ assert.equal(messages[2].dataAsString, '{"type":"message","from":"server","dataType":"text","data":"Hi there!"}');
126
+ });
127
+ });
128
+ //# sourceMappingURL=integration.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.spec.js","sourceRoot":"","sources":["../../test/integration.spec.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,oCAAoC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,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* eslint-disable no-invalid-this */\nimport { WebPubSubServiceClient } from \"../src/index\";\nimport { env, isLiveMode } from \"@azure-tools/test-recorder\";\nimport { Context } from \"mocha\";\nimport { assert } from \"chai\";\nimport ws from \"ws\";\n\nfunction defer<T>(): {\n promise: Promise<T>;\n resolve: (t: T) => void;\n reject: (err: Error) => void;\n} {\n let actualResolve: (t: T) => void;\n let actualReject: (err: Error) => void;\n\n const promise = new Promise<T>((resolve, reject) => {\n actualResolve = resolve;\n actualReject = reject;\n });\n\n return {\n promise,\n resolve: actualResolve!,\n reject: actualReject!\n };\n}\n\nclass SimpleWebSocketFrame {\n public dataAsString: string | undefined;\n constructor(public data: Buffer | ArrayBuffer | Buffer[], public isBinary: boolean) {\n if (!isBinary) {\n this.dataAsString = data.toString();\n }\n }\n\n isEndSignal(): boolean {\n return (\n this.isBinary &&\n this.data instanceof Buffer &&\n this.data[0] === 5 &&\n this.data[1] === 1 &&\n this.data[2] === 1\n );\n }\n}\n\nclass PubSubWebSocketFrame {\n public message: any;\n public dataAsString: string;\n constructor(data: Buffer | ArrayBuffer | Buffer[], isBinary: boolean) {\n assert.isFalse(isBinary);\n this.dataAsString = data.toString();\n this.message = JSON.parse(this.dataAsString);\n }\n\n isEndSignal(): boolean {\n return this.message.dataType === \"binary\" && this.message.data === \"BQEB\";\n }\n}\n\nfunction getEndSignal(): Uint8Array {\n // magic number 511\n const payload = new Uint8Array(3);\n payload[0] = 5;\n payload[1] = 1;\n payload[2] = 1;\n return payload;\n}\n\ndescribe(\"ServiceClient to manage the connected WebSocket connections\", function() {\n it(\"Simple clients can receive expected messages with different content types\", async function(this: Context) {\n if (!isLiveMode()) this.skip();\n const hub = \"SimpleClientCanReceiveMessage\";\n\n const messages: SimpleWebSocketFrame[] = [];\n\n // Get token\n const serviceClient = new WebPubSubServiceClient(env.WPS_CONNECTION_STRING, hub);\n const token = await serviceClient.getClientAccessToken();\n const endSignal = defer<void>();\n // Start simple WebSocket connections\n const client = new ws.WebSocket(token.url);\n client.on(\"message\", (data, isBinary) => {\n const frame = new SimpleWebSocketFrame(data, isBinary);\n if (frame.isEndSignal()) {\n endSignal.resolve();\n client.close();\n } else {\n messages.push(frame);\n }\n });\n client.on(\"open\", async () => {\n // send to all\n // Send a JSON message\n await serviceClient.sendToAll({ message: \"Hello world!\" });\n\n // Send a plain text message\n await serviceClient.sendToAll(\"Hi there!\", { contentType: \"text/plain\" });\n\n // Send the binary end signal message\n await serviceClient.sendToAll(getEndSignal());\n });\n await endSignal.promise;\n\n assert.equal(messages.length, 2);\n assert.equal(messages[0].dataAsString, '{\"message\":\"Hello world!\"}');\n assert.equal(messages[1].dataAsString, \"Hi there!\");\n });\n\n it(\"Subprotocol clients can receive expected messages with different content types\", async function(this: Context) {\n if (!isLiveMode()) this.skip();\n const hub = \"PubSubClientCanReceiveMessage\";\n const messages: PubSubWebSocketFrame[] = [];\n\n // Get token\n const serviceClient = new WebPubSubServiceClient(env.WPS_CONNECTION_STRING, hub);\n const token = await serviceClient.getClientAccessToken();\n const endSignal = defer<void>();\n // Start simple WebSocket connections\n const client = new ws.WebSocket(token.url, \"json.webpubsub.azure.v1\");\n client.on(\"message\", (data, isBinary) => {\n const frame = new PubSubWebSocketFrame(data, isBinary);\n if (frame.isEndSignal()) {\n endSignal.resolve();\n client.close();\n } else {\n messages.push(frame);\n }\n });\n client.on(\"open\", async () => {\n // send to all\n // Send a JSON message\n await serviceClient.sendToAll({ message: \"Hello world!\" });\n\n // Send a plain text message\n await serviceClient.sendToAll(\"Hi there!\", { contentType: \"text/plain\" });\n\n // Send the binary end signal message\n await serviceClient.sendToAll(getEndSignal());\n });\n\n await endSignal.promise;\n\n assert.equal(messages.length, 3);\n assert.equal(messages[0].message.event, \"connected\");\n assert.equal(\n messages[1].dataAsString,\n '{\"type\":\"message\",\"from\":\"server\",\"dataType\":\"json\",\"data\":{\"message\":\"Hello world!\"}}'\n );\n assert.equal(\n messages[2].dataAsString,\n '{\"type\":\"message\",\"from\":\"server\",\"dataType\":\"text\",\"data\":\"Hi there!\"}'\n );\n });\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/web-pubsub",
3
- "version": "1.0.0-alpha.20211028.3",
3
+ "version": "1.0.0-alpha.20211109.4",
4
4
  "description": "Azure client library for Azure Web PubSub",
5
5
  "sdk-type": "client",
6
6
  "main": "dist/index.js",
@@ -82,7 +82,7 @@
82
82
  "devDependencies": {
83
83
  "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
84
84
  "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
85
- "@azure/identity": "^2.0.0",
85
+ "@azure/identity": "^2.0.1",
86
86
  "@azure-tools/test-recorder": "^1.0.0",
87
87
  "@microsoft/api-extractor": "^7.18.11",
88
88
  "@rollup/plugin-commonjs": "11.0.2",
@@ -95,6 +95,7 @@
95
95
  "@types/mocha": "^7.0.2",
96
96
  "@types/node": "^12.0.0",
97
97
  "@types/sinon": "^9.0.4",
98
+ "@types/ws": "^8.2.0",
98
99
  "chai": "^4.2.0",
99
100
  "cross-env": "^7.0.2",
100
101
  "dotenv": "^8.2.0",
@@ -127,7 +128,8 @@
127
128
  "sinon": "^9.0.2",
128
129
  "source-map-support": "^0.5.9",
129
130
  "typescript": "~4.2.0",
130
- "typedoc": "0.15.2"
131
+ "typedoc": "0.15.2",
132
+ "ws": "^8.2.0"
131
133
  },
132
134
  "//sampleConfiguration": {
133
135
  "productName": "Azure Web PubSub",
@@ -284,6 +284,12 @@ export declare interface WebPubSubGroup {
284
284
  * @param options - Additional options
285
285
  */
286
286
  removeConnection(connectionId: string, options?: GroupRemoveConnectionOptions): Promise<void>;
287
+ /**
288
+ * Close all connections to the group
289
+ *
290
+ * @param options - Additional options
291
+ */
292
+ closeAllConnections(options?: GroupCloseAllConnectionsOptions): Promise<void>;
287
293
  /**
288
294
  * Add a user to this group
289
295
  *