@azure/web-pubsub 1.1.4-alpha.20241119.1 → 1.1.4-alpha.20241120.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. package/dist/commonjs/generated/generatedClient.d.ts +19 -0
  2. package/dist/commonjs/generated/generatedClient.d.ts.map +1 -0
  3. package/dist/commonjs/generated/generatedClient.js +76 -0
  4. package/dist/commonjs/generated/generatedClient.js.map +1 -0
  5. package/dist/commonjs/generated/generatedClientContext.d.ts +14 -0
  6. package/dist/commonjs/generated/generatedClientContext.d.ts.map +1 -0
  7. package/dist/commonjs/generated/generatedClientContext.js +46 -0
  8. package/dist/commonjs/generated/generatedClientContext.js.map +1 -0
  9. package/dist/commonjs/generated/index.d.ts +4 -0
  10. package/dist/commonjs/generated/index.d.ts.map +1 -0
  11. package/dist/commonjs/generated/index.js +16 -0
  12. package/dist/commonjs/generated/index.js.map +1 -0
  13. package/dist/commonjs/generated/models/index.d.ts +323 -0
  14. package/dist/commonjs/generated/models/index.d.ts.map +1 -0
  15. package/dist/commonjs/generated/models/index.js +27 -0
  16. package/dist/commonjs/generated/models/index.js.map +1 -0
  17. package/dist/commonjs/generated/models/mappers.d.ts +30 -0
  18. package/dist/commonjs/generated/models/mappers.d.ts.map +1 -0
  19. package/dist/commonjs/generated/models/mappers.js +463 -0
  20. package/dist/commonjs/generated/models/mappers.js.map +1 -0
  21. package/dist/commonjs/generated/models/parameters.d.ts +31 -0
  22. package/dist/commonjs/generated/models/parameters.d.ts.map +1 -0
  23. package/dist/commonjs/generated/models/parameters.js +335 -0
  24. package/dist/commonjs/generated/models/parameters.js.map +1 -0
  25. package/dist/commonjs/generated/operations/healthApi.d.ts +18 -0
  26. package/dist/commonjs/generated/operations/healthApi.d.ts.map +1 -0
  27. package/dist/commonjs/generated/operations/healthApi.js +43 -0
  28. package/dist/commonjs/generated/operations/healthApi.js.map +1 -0
  29. package/dist/commonjs/generated/operations/index.d.ts +3 -0
  30. package/dist/commonjs/generated/operations/index.d.ts.map +1 -0
  31. package/dist/commonjs/generated/operations/index.js +13 -0
  32. package/dist/commonjs/generated/operations/index.js.map +1 -0
  33. package/dist/commonjs/generated/operations/webPubSub.d.ts +249 -0
  34. package/dist/commonjs/generated/operations/webPubSub.d.ts.map +1 -0
  35. package/dist/commonjs/generated/operations/webPubSub.js +874 -0
  36. package/dist/commonjs/generated/operations/webPubSub.js.map +1 -0
  37. package/dist/commonjs/generated/operationsInterfaces/healthApi.d.ts +10 -0
  38. package/dist/commonjs/generated/operationsInterfaces/healthApi.d.ts.map +1 -0
  39. package/dist/commonjs/generated/operationsInterfaces/healthApi.js +10 -0
  40. package/dist/commonjs/generated/operationsInterfaces/healthApi.js.map +1 -0
  41. package/dist/commonjs/generated/operationsInterfaces/index.d.ts +3 -0
  42. package/dist/commonjs/generated/operationsInterfaces/index.d.ts.map +1 -0
  43. package/dist/commonjs/generated/operationsInterfaces/index.js +13 -0
  44. package/dist/commonjs/generated/operationsInterfaces/index.js.map +1 -0
  45. package/dist/commonjs/generated/operationsInterfaces/webPubSub.d.ts +224 -0
  46. package/dist/commonjs/generated/operationsInterfaces/webPubSub.d.ts.map +1 -0
  47. package/dist/commonjs/generated/operationsInterfaces/webPubSub.js +10 -0
  48. package/dist/commonjs/generated/operationsInterfaces/webPubSub.js.map +1 -0
  49. package/dist/commonjs/groupClient.d.ts +232 -0
  50. package/dist/commonjs/groupClient.d.ts.map +1 -0
  51. package/dist/commonjs/groupClient.js +101 -0
  52. package/dist/commonjs/groupClient.js.map +1 -0
  53. package/dist/commonjs/hubClient.d.ts +478 -0
  54. package/dist/commonjs/hubClient.d.ts.map +1 -0
  55. package/dist/commonjs/hubClient.js +372 -0
  56. package/dist/commonjs/hubClient.js.map +1 -0
  57. package/dist/commonjs/index.d.ts +5 -0
  58. package/dist/commonjs/index.d.ts.map +1 -0
  59. package/dist/commonjs/index.js +12 -0
  60. package/dist/commonjs/index.js.map +1 -0
  61. package/dist/commonjs/logger.d.ts +5 -0
  62. package/dist/commonjs/logger.d.ts.map +1 -0
  63. package/dist/commonjs/logger.js +11 -0
  64. package/dist/commonjs/logger.js.map +1 -0
  65. package/dist/commonjs/package.json +3 -0
  66. package/dist/commonjs/parseConnectionString.d.ts +8 -0
  67. package/dist/commonjs/parseConnectionString.d.ts.map +1 -0
  68. package/dist/commonjs/parseConnectionString.js +34 -0
  69. package/dist/commonjs/parseConnectionString.js.map +1 -0
  70. package/dist/commonjs/reverseProxyPolicy.d.ts +9 -0
  71. package/dist/commonjs/reverseProxyPolicy.d.ts.map +1 -0
  72. package/dist/commonjs/reverseProxyPolicy.js +25 -0
  73. package/dist/commonjs/reverseProxyPolicy.js.map +1 -0
  74. package/dist/commonjs/tracing.d.ts +3 -0
  75. package/dist/commonjs/tracing.d.ts.map +1 -0
  76. package/dist/commonjs/tracing.js +12 -0
  77. package/dist/commonjs/tracing.js.map +1 -0
  78. package/dist/commonjs/tsdoc-metadata.json +11 -0
  79. package/dist/commonjs/utils.d.ts +29 -0
  80. package/dist/commonjs/utils.d.ts.map +1 -0
  81. package/dist/commonjs/utils.js +73 -0
  82. package/dist/commonjs/utils.js.map +1 -0
  83. package/dist/commonjs/webPubSubCredentialPolicy.d.ts +13 -0
  84. package/dist/commonjs/webPubSubCredentialPolicy.d.ts.map +1 -0
  85. package/dist/commonjs/webPubSubCredentialPolicy.js +32 -0
  86. package/dist/commonjs/webPubSubCredentialPolicy.js.map +1 -0
  87. package/dist/esm/generated/generatedClient.d.ts +19 -0
  88. package/dist/esm/generated/generatedClient.d.ts.map +1 -0
  89. package/{dist-esm/src → dist/esm}/generated/generatedClient.js +1 -1
  90. package/dist/esm/generated/generatedClient.js.map +1 -0
  91. package/dist/esm/generated/generatedClientContext.d.ts +14 -0
  92. package/dist/esm/generated/generatedClientContext.d.ts.map +1 -0
  93. package/dist/esm/generated/generatedClientContext.js.map +1 -0
  94. package/dist/esm/generated/index.d.ts +4 -0
  95. package/dist/esm/generated/index.d.ts.map +1 -0
  96. package/{dist-esm/src → dist/esm}/generated/index.js +3 -3
  97. package/dist/esm/generated/index.js.map +1 -0
  98. package/dist/esm/generated/models/index.d.ts +323 -0
  99. package/dist/esm/generated/models/index.d.ts.map +1 -0
  100. package/dist/esm/generated/models/mappers.d.ts +30 -0
  101. package/dist/esm/generated/models/mappers.d.ts.map +1 -0
  102. package/dist/esm/generated/models/parameters.d.ts +31 -0
  103. package/dist/esm/generated/models/parameters.d.ts.map +1 -0
  104. package/{dist-esm/src → dist/esm}/generated/models/parameters.js +1 -1
  105. package/dist/esm/generated/models/parameters.js.map +1 -0
  106. package/dist/esm/generated/operations/healthApi.d.ts +18 -0
  107. package/dist/esm/generated/operations/healthApi.d.ts.map +1 -0
  108. package/{dist-esm/src → dist/esm}/generated/operations/healthApi.js +2 -2
  109. package/dist/esm/generated/operations/healthApi.js.map +1 -0
  110. package/dist/esm/generated/operations/index.d.ts +3 -0
  111. package/dist/esm/generated/operations/index.d.ts.map +1 -0
  112. package/{dist-esm/src/generated/operationsInterfaces → dist/esm/generated/operations}/index.js +2 -2
  113. package/dist/esm/generated/operations/index.js.map +1 -0
  114. package/dist/esm/generated/operations/webPubSub.d.ts +249 -0
  115. package/dist/esm/generated/operations/webPubSub.d.ts.map +1 -0
  116. package/{dist-esm/src → dist/esm}/generated/operations/webPubSub.js +2 -2
  117. package/dist/esm/generated/operations/webPubSub.js.map +1 -0
  118. package/dist/esm/generated/operationsInterfaces/healthApi.d.ts +10 -0
  119. package/dist/esm/generated/operationsInterfaces/healthApi.d.ts.map +1 -0
  120. package/{dist-esm/src → dist/esm}/generated/operationsInterfaces/healthApi.js.map +1 -1
  121. package/dist/esm/generated/operationsInterfaces/index.d.ts +3 -0
  122. package/dist/esm/generated/operationsInterfaces/index.d.ts.map +1 -0
  123. package/{dist-esm/src/generated/operations → dist/esm/generated/operationsInterfaces}/index.js +2 -2
  124. package/dist/esm/generated/operationsInterfaces/index.js.map +1 -0
  125. package/dist/esm/generated/operationsInterfaces/webPubSub.d.ts +224 -0
  126. package/dist/esm/generated/operationsInterfaces/webPubSub.d.ts.map +1 -0
  127. package/dist/esm/generated/operationsInterfaces/webPubSub.js.map +1 -0
  128. package/dist/esm/groupClient.d.ts +232 -0
  129. package/dist/esm/groupClient.d.ts.map +1 -0
  130. package/{dist-esm/src → dist/esm}/groupClient.js +2 -2
  131. package/dist/esm/groupClient.js.map +1 -0
  132. package/dist/esm/hubClient.d.ts +478 -0
  133. package/dist/esm/hubClient.d.ts.map +1 -0
  134. package/{dist-esm/src → dist/esm}/hubClient.js +9 -9
  135. package/dist/esm/hubClient.js.map +1 -0
  136. package/dist/esm/index.d.ts +5 -0
  137. package/dist/esm/index.d.ts.map +1 -0
  138. package/{dist-esm/src → dist/esm}/index.js +2 -2
  139. package/dist/esm/index.js.map +1 -0
  140. package/dist/esm/logger.d.ts +5 -0
  141. package/dist/esm/logger.d.ts.map +1 -0
  142. package/dist/esm/package.json +3 -0
  143. package/dist/esm/parseConnectionString.d.ts +8 -0
  144. package/dist/esm/parseConnectionString.d.ts.map +1 -0
  145. package/dist/esm/reverseProxyPolicy.d.ts +9 -0
  146. package/dist/esm/reverseProxyPolicy.d.ts.map +1 -0
  147. package/dist/esm/tracing.d.ts +3 -0
  148. package/dist/esm/tracing.d.ts.map +1 -0
  149. package/dist/esm/utils.d.ts +29 -0
  150. package/dist/esm/utils.d.ts.map +1 -0
  151. package/dist/esm/webPubSubCredentialPolicy.d.ts +13 -0
  152. package/dist/esm/webPubSubCredentialPolicy.d.ts.map +1 -0
  153. package/package.json +56 -52
  154. package/dist/index.js +0 -2441
  155. package/dist/index.js.map +0 -1
  156. package/dist-esm/samples-dev/broadcasting.js +0 -27
  157. package/dist-esm/samples-dev/broadcasting.js.map +0 -1
  158. package/dist-esm/samples-dev/directMessage.js +0 -20
  159. package/dist-esm/samples-dev/directMessage.js.map +0 -1
  160. package/dist-esm/samples-dev/managingGroups.js +0 -23
  161. package/dist-esm/samples-dev/managingGroups.js.map +0 -1
  162. package/dist-esm/src/generated/generatedClient.js.map +0 -1
  163. package/dist-esm/src/generated/generatedClientContext.js.map +0 -1
  164. package/dist-esm/src/generated/index.js.map +0 -1
  165. package/dist-esm/src/generated/models/parameters.js.map +0 -1
  166. package/dist-esm/src/generated/operations/healthApi.js.map +0 -1
  167. package/dist-esm/src/generated/operations/index.js.map +0 -1
  168. package/dist-esm/src/generated/operations/webPubSub.js.map +0 -1
  169. package/dist-esm/src/generated/operationsInterfaces/index.js.map +0 -1
  170. package/dist-esm/src/generated/operationsInterfaces/webPubSub.js.map +0 -1
  171. package/dist-esm/src/groupClient.js.map +0 -1
  172. package/dist-esm/src/hubClient.js.map +0 -1
  173. package/dist-esm/src/index.js.map +0 -1
  174. package/dist-esm/test/conn.spec.js +0 -23
  175. package/dist-esm/test/conn.spec.js.map +0 -1
  176. package/dist-esm/test/groups.spec.js +0 -138
  177. package/dist-esm/test/groups.spec.js.map +0 -1
  178. package/dist-esm/test/hubs.spec.js +0 -270
  179. package/dist-esm/test/hubs.spec.js.map +0 -1
  180. package/dist-esm/test/integration.spec.js +0 -299
  181. package/dist-esm/test/integration.spec.js.map +0 -1
  182. package/dist-esm/test/odata.spec.js +0 -15
  183. package/dist-esm/test/odata.spec.js.map +0 -1
  184. package/dist-esm/test/testEnv.js +0 -23
  185. package/dist-esm/test/testEnv.js.map +0 -1
  186. /package/{dist-esm/src → dist/esm}/generated/generatedClientContext.js +0 -0
  187. /package/{dist-esm/src → dist/esm}/generated/models/index.js +0 -0
  188. /package/{dist-esm/src → dist/esm}/generated/models/index.js.map +0 -0
  189. /package/{dist-esm/src → dist/esm}/generated/models/mappers.js +0 -0
  190. /package/{dist-esm/src → dist/esm}/generated/models/mappers.js.map +0 -0
  191. /package/{dist-esm/src → dist/esm}/generated/operationsInterfaces/healthApi.js +0 -0
  192. /package/{dist-esm/src → dist/esm}/generated/operationsInterfaces/webPubSub.js +0 -0
  193. /package/{dist-esm/src → dist/esm}/logger.js +0 -0
  194. /package/{dist-esm/src → dist/esm}/logger.js.map +0 -0
  195. /package/{dist-esm/src → dist/esm}/parseConnectionString.js +0 -0
  196. /package/{dist-esm/src → dist/esm}/parseConnectionString.js.map +0 -0
  197. /package/{dist-esm/src → dist/esm}/reverseProxyPolicy.js +0 -0
  198. /package/{dist-esm/src → dist/esm}/reverseProxyPolicy.js.map +0 -0
  199. /package/{dist-esm/src → dist/esm}/tracing.js +0 -0
  200. /package/{dist-esm/src → dist/esm}/tracing.js.map +0 -0
  201. /package/{dist-esm/src → dist/esm}/utils.js +0 -0
  202. /package/{dist-esm/src → dist/esm}/utils.js.map +0 -0
  203. /package/{dist-esm/src → dist/esm}/webPubSubCredentialPolicy.js +0 -0
  204. /package/{dist-esm/src → dist/esm}/webPubSubCredentialPolicy.js.map +0 -0
  205. /package/{types → dist}/web-pubsub.d.ts +0 -0
@@ -0,0 +1,232 @@
1
+ import type { CommonClientOptions, OperationOptions } from "@azure/core-client";
2
+ import type { RequestBodyType } from "@azure/core-rest-pipeline";
3
+ import type { GeneratedClient } from "./generated/generatedClient.js";
4
+ import type { JSONTypes } from "./hubClient.js";
5
+ /**
6
+ * Options for constructing a GroupAdmin client.
7
+ */
8
+ export interface GroupAdminClientOptions extends CommonClientOptions {
9
+ }
10
+ /**
11
+ * Options for adding a connection to a group.
12
+ */
13
+ export interface GroupAddConnectionOptions extends OperationOptions {
14
+ }
15
+ /**
16
+ * Options for adding a user to a group.
17
+ */
18
+ export interface GroupAddUserOptions extends OperationOptions {
19
+ }
20
+ /**
21
+ * Options for checking if a user is in a group
22
+ */
23
+ export interface GroupHasUserOptions extends OperationOptions {
24
+ }
25
+ /**
26
+ * Options for removing a user from a group
27
+ */
28
+ export interface GroupRemoveUserOptions extends OperationOptions {
29
+ }
30
+ /**
31
+ * Options for removing a connection from a group
32
+ */
33
+ export interface GroupRemoveConnectionOptions extends OperationOptions {
34
+ }
35
+ /**
36
+ * Options for sending messages to a group.
37
+ */
38
+ export interface GroupSendToAllOptions extends OperationOptions {
39
+ /**
40
+ * Connection ids to exclude from receiving this message.
41
+ */
42
+ excludedConnections?: string[];
43
+ /**
44
+ * The filter syntax to filter out the connections to send the messages to following OData filter syntax.
45
+ * Examples:
46
+ * * Exclude connections from `user1` and `user2`: `userId ne 'user1' and userId ne 'user2'`
47
+ * * Exclude connections in `group1`: `not('group1' in groups)`
48
+ * Details about `filter` syntax please see [OData filter syntax for Azure Web PubSub](https://aka.ms/awps/filter-syntax).
49
+ */
50
+ filter?: string;
51
+ /**
52
+ * The time-to-live (TTL) value in seconds for messages sent to the service.
53
+ * 0 is the default value, which means the message never expires.
54
+ * 300 is the maximum value.
55
+ * If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service.
56
+ * This parameter can help when the client's bandwidth is limited.
57
+ */
58
+ messageTtlSeconds?: number;
59
+ }
60
+ /**
61
+ * Options for sending text messages to a group..
62
+ */
63
+ export interface GroupSendTextToAllOptions extends GroupSendToAllOptions {
64
+ /**
65
+ * The content will be sent to the clients in plain text.
66
+ */
67
+ contentType: "text/plain";
68
+ }
69
+ /**
70
+ * Options for closing all connections to a group.
71
+ */
72
+ export interface GroupCloseAllConnectionsOptions extends OperationOptions {
73
+ /**
74
+ * Reason the connection is being closed.
75
+ */
76
+ reason?: string;
77
+ }
78
+ export interface WebPubSubGroup {
79
+ /**
80
+ * The name of this group
81
+ */
82
+ readonly groupName: string;
83
+ /**
84
+ * The name of the hub this group belongs to
85
+ */
86
+ readonly hubName: string;
87
+ /**
88
+ * The Web PubSub API version being used by this client
89
+ */
90
+ readonly apiVersion: string;
91
+ /**
92
+ * The Web PubSub endpoint this client is connected to
93
+ */
94
+ readonly endpoint: string;
95
+ /**
96
+ * Add a specific connection to this group
97
+ *
98
+ * @param connectionId - The connection id to add to this group
99
+ * @param options - Additional options
100
+ */
101
+ addConnection(connectionId: string, options?: GroupAddConnectionOptions): Promise<void>;
102
+ /**
103
+ * Remove a specific connection from this group
104
+ *
105
+ * @param connectionId - The connection id to remove from this group
106
+ * @param options - Additional options
107
+ */
108
+ removeConnection(connectionId: string, options?: GroupRemoveConnectionOptions): Promise<void>;
109
+ /**
110
+ * Close all connections to the group
111
+ *
112
+ * @param options - Additional options
113
+ */
114
+ closeAllConnections(options?: GroupCloseAllConnectionsOptions): Promise<void>;
115
+ /**
116
+ * Add a user to this group
117
+ *
118
+ * @param username - The user name to add
119
+ * @param options - Additional options
120
+ */
121
+ addUser(username: string, options?: GroupAddUserOptions): Promise<void>;
122
+ /**
123
+ * Remove a user from this group
124
+ *
125
+ * @param username - The user name to remove
126
+ * @param options - Additional options
127
+ */
128
+ removeUser(username: string, options?: GroupRemoveUserOptions): Promise<void>;
129
+ /**
130
+ * Send a text message to every connection in this group
131
+ *
132
+ * @param message - The message to send
133
+ * @param options - Additional options
134
+ */
135
+ sendToAll(message: string, options: GroupSendTextToAllOptions): Promise<void>;
136
+ /**
137
+ * Send a json message to every connection in this group
138
+ *
139
+ * @param message - The message to send
140
+ * @param options - Additional options
141
+ */
142
+ sendToAll(message: JSONTypes, options?: GroupSendToAllOptions): Promise<void>;
143
+ /**
144
+ * Send a binary message to every connection in this group
145
+ *
146
+ * @param message - The binary message to send
147
+ * @param options - Additional options
148
+ */
149
+ sendToAll(message: RequestBodyType, options?: GroupSendToAllOptions): Promise<void>;
150
+ }
151
+ /**
152
+ * @hidden
153
+ */
154
+ export declare class WebPubSubGroupImpl implements WebPubSubGroup {
155
+ private client;
156
+ /**
157
+ * The name of this group
158
+ */
159
+ readonly groupName: string;
160
+ /**
161
+ * The name of the hub this group belongs to
162
+ */
163
+ readonly hubName: string;
164
+ /**
165
+ * The Web PubSub API version being used by this client
166
+ */
167
+ readonly apiVersion: string;
168
+ /**
169
+ * The Web PubSub endpoint this client is connected to
170
+ */
171
+ endpoint: string;
172
+ /**
173
+ * @internal
174
+ */
175
+ constructor(client: GeneratedClient, hubName: string, groupName: string);
176
+ /**
177
+ * Add a specific connection to this group
178
+ *
179
+ * @param connectionId - The connection id to add to this group
180
+ * @param options - Additional options
181
+ */
182
+ addConnection(connectionId: string, options?: GroupAddConnectionOptions): Promise<void>;
183
+ /**
184
+ * Remove a specific connection from this group
185
+ *
186
+ * @param connectionId - The connection id to remove from this group
187
+ * @param options - Additional options
188
+ */
189
+ removeConnection(connectionId: string, options?: GroupRemoveConnectionOptions): Promise<void>;
190
+ /**
191
+ * Close all connections to this group
192
+ *
193
+ * @param options - Additional options
194
+ */
195
+ closeAllConnections(options?: GroupCloseAllConnectionsOptions): Promise<void>;
196
+ /**
197
+ * Add a user to this group
198
+ *
199
+ * @param username - The user name to add
200
+ * @param options - Additional options
201
+ */
202
+ addUser(username: string, options?: GroupAddUserOptions): Promise<void>;
203
+ /**
204
+ * Remove a user from this group
205
+ *
206
+ * @param username - The user name to remove
207
+ * @param options - Additional options
208
+ */
209
+ removeUser(username: string, options?: GroupRemoveUserOptions): Promise<void>;
210
+ /**
211
+ * Send a text message to every connection in this group
212
+ *
213
+ * @param message - The message to send
214
+ * @param options - Additional options
215
+ */
216
+ sendToAll(message: string, options: GroupSendTextToAllOptions): Promise<void>;
217
+ /**
218
+ * Send a json message to every connection in this group
219
+ *
220
+ * @param message - The message to send
221
+ * @param options - Additional options
222
+ */
223
+ sendToAll(message: JSONTypes, options?: GroupSendToAllOptions): Promise<void>;
224
+ /**
225
+ * Send a binary message to every connection in this group
226
+ *
227
+ * @param message - The binary message to send
228
+ * @param options - Additional options
229
+ */
230
+ sendToAll(message: RequestBodyType, options?: GroupSendToAllOptions): Promise<void>;
231
+ }
232
+ //# sourceMappingURL=groupClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groupClient.d.ts","sourceRoot":"","sources":["../../src/groupClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,mBAAmB,EAEnB,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGtE,OAAO,KAAK,EAAE,SA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AE,yBAA8B,GACtC,OAAO,CAAC,IAAI,CAAC;IAkChB;;;;;OAKG;IACU,gBAAgB,CAC3B,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,IAAI,CAAC;IAehB;;;;OAIG;IACU,mBAAmB,CAAC,OAAO,GAAE,+BAAoC,GAAG,OAAO,CAAC,IAAI,CAAC;IAa9F;;;;;OAKG;IACU,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAWxF;;;;;OAKG;IACU,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IAW9F;;;;;OAKG;IACU,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1F;;;;;OAKG;IACU,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1F;;;;;OAKG;IACU,SAAS,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;CAiBjG"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.WebPubSubGroupImpl = void 0;
6
+ const core_rest_pipeline_1 = require("@azure/core-rest-pipeline");
7
+ const tracing_js_1 = require("./tracing.js");
8
+ const utils_js_1 = require("./utils.js");
9
+ /**
10
+ * @hidden
11
+ */
12
+ class WebPubSubGroupImpl {
13
+ /**
14
+ * @internal
15
+ */
16
+ constructor(client, hubName, groupName) {
17
+ /**
18
+ * The Web PubSub API version being used by this client
19
+ */
20
+ this.apiVersion = "2020-10-01";
21
+ this.client = client;
22
+ this.groupName = groupName;
23
+ this.hubName = hubName;
24
+ }
25
+ /**
26
+ * Add a specific connection to this group
27
+ *
28
+ * @param connectionId - The connection id to add to this group
29
+ * @param options - Additional options
30
+ */
31
+ async addConnection(connectionId, options = {}) {
32
+ let response;
33
+ function onResponse(rawResponse, flatResponse) {
34
+ response = rawResponse;
35
+ if (options.onResponse) {
36
+ options.onResponse(rawResponse, flatResponse);
37
+ }
38
+ }
39
+ return tracing_js_1.tracingClient.withSpan("WebPubSubGroupClient.addConnection", options, async (updatedOptions) => {
40
+ await this.client.webPubSub.addConnectionToGroup(this.hubName, this.groupName, connectionId, Object.assign(Object.assign({}, updatedOptions), { onResponse }));
41
+ if (response.status === 404) {
42
+ throw new core_rest_pipeline_1.RestError(`Connection id '${connectionId}' doesn't exist`, {
43
+ statusCode: response === null || response === void 0 ? void 0 : response.status,
44
+ request: response === null || response === void 0 ? void 0 : response.request,
45
+ response: response,
46
+ });
47
+ }
48
+ });
49
+ }
50
+ /**
51
+ * Remove a specific connection from this group
52
+ *
53
+ * @param connectionId - The connection id to remove from this group
54
+ * @param options - Additional options
55
+ */
56
+ async removeConnection(connectionId, options = {}) {
57
+ return tracing_js_1.tracingClient.withSpan("WebPubSubGroupClient.removeConnection", options, (updatedOptions) => {
58
+ return this.client.webPubSub.removeConnectionFromGroup(this.hubName, this.groupName, connectionId, updatedOptions);
59
+ });
60
+ }
61
+ /**
62
+ * Close all connections to this group
63
+ *
64
+ * @param options - Additional options
65
+ */
66
+ async closeAllConnections(options = {}) {
67
+ return tracing_js_1.tracingClient.withSpan("WebPubSubGroupClient.closeAllConnections", options, (updatedOptions) => {
68
+ return this.client.webPubSub.closeGroupConnections(this.hubName, this.groupName, updatedOptions);
69
+ });
70
+ }
71
+ /**
72
+ * Add a user to this group
73
+ *
74
+ * @param username - The user name to add
75
+ * @param options - Additional options
76
+ */
77
+ async addUser(username, options = {}) {
78
+ return tracing_js_1.tracingClient.withSpan("WebPubSubGroupClient.addUser", options, (updatedOptions) => {
79
+ return this.client.webPubSub.addUserToGroup(this.hubName, this.groupName, username, updatedOptions);
80
+ });
81
+ }
82
+ /**
83
+ * Remove a user from this group
84
+ *
85
+ * @param username - The user name to remove
86
+ * @param options - Additional options
87
+ */
88
+ async removeUser(username, options = {}) {
89
+ return tracing_js_1.tracingClient.withSpan("WebPubSubGroupClient.removeUser", options, (updatedOptions) => {
90
+ return this.client.webPubSub.removeUserFromGroup(this.hubName, this.groupName, username, updatedOptions);
91
+ });
92
+ }
93
+ async sendToAll(message, options = {}) {
94
+ return tracing_js_1.tracingClient.withSpan("WebPubSubGroupClient.sendToAll", options, (updatedOptions) => {
95
+ const { contentType, payload } = (0, utils_js_1.getPayloadForMessage)(message, updatedOptions);
96
+ return this.client.webPubSub.sendToGroup(this.hubName, this.groupName, contentType, payload, updatedOptions);
97
+ });
98
+ }
99
+ }
100
+ exports.WebPubSubGroupImpl = WebPubSubGroupImpl;
101
+ //# sourceMappingURL=groupClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groupClient.js","sourceRoot":"","sources":["../../src/groupClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAQlC,kEAAsD;AAEtD,6CAA6C;AAC7C,yCAAkD;AAkKlD;;GAEG;AACH,MAAa,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,IAAI,QAA2C,CAAC;QAChD,SAAS,UAAU,CAAC,WAAkC,EAAE,YAAqB;YAC3E,QAAQ,GAAG,WAAW,CAAC;YACvB,I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3LD,gDA2LC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n CommonClientOptions,\n FullOperationResponse,\n OperationOptions,\n} from \"@azure/core-client\";\nimport type { RequestBodyType } from \"@azure/core-rest-pipeline\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport type { GeneratedClient } from \"./generated/generatedClient.js\";\nimport { tracingClient } from \"./tracing.js\";\nimport { getPayloadForMessage } from \"./utils.js\";\nimport type { JSONTypes } from \"./hubClient.js\";\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 * The filter syntax to filter out the connections to send the messages to following OData filter syntax.\n * Examples:\n * * Exclude connections from `user1` and `user2`: `userId ne 'user1' and userId ne 'user2'`\n * * Exclude connections in `group1`: `not('group1' in groups)`\n * Details about `filter` syntax please see [OData filter syntax for Azure Web PubSub](https://aka.ms/awps/filter-syntax).\n */\n filter?: string;\n /**\n * The time-to-live (TTL) value in seconds for messages sent to the service.\n * 0 is the default value, which means the message never expires.\n * 300 is the maximum value.\n * If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service.\n * This parameter can help when the client's bandwidth is limited.\n */\n messageTtlSeconds?: number;\n}\n\n/**\n * Options for sending text messages to a group..\n */\nexport interface GroupSendTextToAllOptions extends GroupSendToAllOptions {\n /**\n * The content will be sent to the clients in plain text.\n */\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 let response: FullOperationResponse | undefined;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n response = rawResponse;\n if (options.onResponse) {\n options.onResponse(rawResponse, flatResponse);\n }\n }\n\n return tracingClient.withSpan(\n \"WebPubSubGroupClient.addConnection\",\n options,\n async (updatedOptions) => {\n await this.client.webPubSub.addConnectionToGroup(\n this.hubName,\n this.groupName,\n connectionId,\n {\n ...updatedOptions,\n onResponse,\n },\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 },\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 return tracingClient.withSpan(\n \"WebPubSubGroupClient.removeConnection\",\n options,\n (updatedOptions) => {\n return this.client.webPubSub.removeConnectionFromGroup(\n this.hubName,\n this.groupName,\n connectionId,\n updatedOptions,\n );\n },\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 return tracingClient.withSpan(\n \"WebPubSubGroupClient.closeAllConnections\",\n options,\n (updatedOptions) => {\n return this.client.webPubSub.closeGroupConnections(\n this.hubName,\n this.groupName,\n updatedOptions,\n );\n },\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 return tracingClient.withSpan(\"WebPubSubGroupClient.addUser\", options, (updatedOptions) => {\n return this.client.webPubSub.addUserToGroup(\n this.hubName,\n this.groupName,\n username,\n updatedOptions,\n );\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 return tracingClient.withSpan(\"WebPubSubGroupClient.removeUser\", options, (updatedOptions) => {\n return this.client.webPubSub.removeUserFromGroup(\n this.hubName,\n this.groupName,\n username,\n updatedOptions,\n );\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 return tracingClient.withSpan(\"WebPubSubGroupClient.sendToAll\", options, (updatedOptions) => {\n const { contentType, payload } = getPayloadForMessage(message, updatedOptions);\n return this.client.webPubSub.sendToGroup(\n this.hubName,\n this.groupName,\n contentType,\n payload as any,\n updatedOptions,\n );\n });\n }\n}\n"]}