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

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,3 @@
1
+ /** @internal */
2
+ export declare const tracingClient: import("@azure/core-tracing").TracingClient;
3
+ //# sourceMappingURL=tracing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../src/tracing.ts"],"names":[],"mappings":"AAKA,gBAAgB;AAChB,eAAO,MAAM,aAAa,6CAGxB,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.tracingClient = void 0;
6
+ const core_tracing_1 = require("@azure/core-tracing");
7
+ /** @internal */
8
+ exports.tracingClient = (0, core_tracing_1.createTracingClient)({
9
+ namespace: "Microsoft.WebPubSub",
10
+ packageName: "@azure/web-pubsub",
11
+ });
12
+ //# sourceMappingURL=tracing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../src/tracing.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,sDAA0D;AAE1D,gBAAgB;AACH,QAAA,aAAa,GAAG,IAAA,kCAAmB,EAAC;IAC/C,SAAS,EAAE,qBAAqB;IAChC,WAAW,EAAE,mBAAmB;CACjC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createTracingClient } from \"@azure/core-tracing\";\n\n/** @internal */\nexport const tracingClient = createTracingClient({\n namespace: \"Microsoft.WebPubSub\",\n packageName: \"@azure/web-pubsub\",\n});\n"]}
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.47.11"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,29 @@
1
+ import type { RequestBodyType } from "@azure/core-rest-pipeline";
2
+ export interface TextPlainPayload {
3
+ contentType: "text/plain";
4
+ payload: string;
5
+ }
6
+ export interface JsonPayload {
7
+ contentType: "application/json";
8
+ payload: string;
9
+ }
10
+ export interface BinaryPayload {
11
+ contentType: "application/octet-stream";
12
+ payload: RequestBodyType;
13
+ }
14
+ export type Payload = TextPlainPayload | JsonPayload | BinaryPayload;
15
+ export declare function getPayloadForMessage(message: unknown, options: Record<string, any>): Payload;
16
+ /**
17
+ * Escapes an odata filter expression to avoid errors with quoting string literals.
18
+ * Example usage:
19
+ * ```ts
20
+ * const userId = "vic's";
21
+ * const anonymous = null;
22
+ * const length = 3
23
+ * const filter = odata`userId eq ${anonymous} or userId eq ${userId} or length(userId) > ${length}`;
24
+ * ```
25
+ * @param strings - Array of strings for the expression
26
+ * @param values - Array of values for the expression
27
+ */
28
+ export declare function odata(strings: TemplateStringsArray, ...values: unknown[]): string;
29
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAajE,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,YAAY,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,kBAAkB,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,0BAA0B,CAAC;IACxC,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,MAAM,OAAO,GAAG,gBAAgB,GAAG,WAAW,GAAG,aAAa,CAAC;AAErE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAW5F;AAwBD;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAajF"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getPayloadForMessage = getPayloadForMessage;
6
+ exports.odata = odata;
7
+ function isRequestBody(obj) {
8
+ return (typeof obj === "function" ||
9
+ (typeof obj === "object" &&
10
+ obj != null &&
11
+ (obj.constructor.name === "ArrayBuffer" ||
12
+ obj.constructor.name === "Blob" ||
13
+ ArrayBuffer.isView(obj))));
14
+ }
15
+ function getPayloadForMessage(message, options) {
16
+ if ((options === null || options === void 0 ? void 0 : options.contentType) === "text/plain") {
17
+ if (typeof message !== "string") {
18
+ throw new TypeError("Message must be a string.");
19
+ }
20
+ return { contentType: "text/plain", payload: message };
21
+ }
22
+ else if (isRequestBody(message)) {
23
+ return { contentType: "application/octet-stream", payload: message };
24
+ }
25
+ else {
26
+ return { contentType: "application/json", payload: JSON.stringify(message) };
27
+ }
28
+ }
29
+ function formatNullAndUndefined(input) {
30
+ if (input === null || input === undefined) {
31
+ return "null";
32
+ }
33
+ return input;
34
+ }
35
+ function escapeQuotesIfString(input, previous) {
36
+ let result = input;
37
+ if (typeof input === "string") {
38
+ result = input.replace(/'/g, "''");
39
+ // check if we need to escape this literal
40
+ if (!previous.trim().endsWith("'")) {
41
+ result = `'${result}'`;
42
+ }
43
+ }
44
+ return result;
45
+ }
46
+ /**
47
+ * Escapes an odata filter expression to avoid errors with quoting string literals.
48
+ * Example usage:
49
+ * ```ts
50
+ * const userId = "vic's";
51
+ * const anonymous = null;
52
+ * const length = 3
53
+ * const filter = odata`userId eq ${anonymous} or userId eq ${userId} or length(userId) > ${length}`;
54
+ * ```
55
+ * @param strings - Array of strings for the expression
56
+ * @param values - Array of values for the expression
57
+ */
58
+ function odata(strings, ...values) {
59
+ const results = [];
60
+ for (let i = 0; i < strings.length; i++) {
61
+ results.push(strings[i]);
62
+ if (i < values.length) {
63
+ if (values[i] === null || values[i] === undefined) {
64
+ results.push(formatNullAndUndefined(values[i]));
65
+ }
66
+ else {
67
+ results.push(escapeQuotesIfString(values[i], strings[i]));
68
+ }
69
+ }
70
+ }
71
+ return results.join("");
72
+ }
73
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAgClC,oDAWC;AAoCD,sBAaC;AAxFD,SAAS,aAAa,CAAC,GAAY;IACjC,OAAO,CACL,OAAO,GAAG,KAAK,UAAU;QACzB,CAAC,OAAO,GAAG,KAAK,QAAQ;YACtB,GAAG,IAAI,IAAI;YACX,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,KAAK,aAAa;gBACrC,GAAG,CAAC,WAAW,CAAC,IAAI,KAAK,MAAM;gBAC/B,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAC9B,CAAC;AACJ,CAAC;AAmBD,SAAgB,oBAAoB,CAAC,OAAgB,EAAE,OAA4B;IACjF,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,MAAK,YAAY,EAAE,CAAC;QAC1C,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,MAAM,IAAI,SAAS,CAAC,2BAA2B,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IACzD,CAAC;SAAM,IAAI,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IACvE,CAAC;SAAM,CAAC;QACN,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/E,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAc;IAC5C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAc,EAAE,QAAgB;IAC5D,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACnC,0CAA0C;QAC1C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,MAAM,GAAG,IAAI,MAAM,GAAG,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,KAAK,CAAC,OAA6B,EAAE,GAAG,MAAiB;IACvE,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;YACtB,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;gBAClD,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAClD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { 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\nfunction formatNullAndUndefined(input: unknown): string | unknown {\n if (input === null || input === undefined) {\n return \"null\";\n }\n\n return input;\n}\n\nfunction escapeQuotesIfString(input: unknown, previous: string): string | unknown {\n let result = input;\n\n if (typeof input === \"string\") {\n result = input.replace(/'/g, \"''\");\n // check if we need to escape this literal\n if (!previous.trim().endsWith(\"'\")) {\n result = `'${result}'`;\n }\n }\n\n return result;\n}\n\n/**\n * Escapes an odata filter expression to avoid errors with quoting string literals.\n * Example usage:\n * ```ts\n * const userId = \"vic's\";\n * const anonymous = null;\n * const length = 3\n * const filter = odata`userId eq ${anonymous} or userId eq ${userId} or length(userId) > ${length}`;\n * ```\n * @param strings - Array of strings for the expression\n * @param values - Array of values for the expression\n */\nexport function odata(strings: TemplateStringsArray, ...values: unknown[]): string {\n const results = [];\n for (let i = 0; i < strings.length; i++) {\n results.push(strings[i]);\n if (i < values.length) {\n if (values[i] === null || values[i] === undefined) {\n results.push(formatNullAndUndefined(values[i]));\n } else {\n results.push(escapeQuotesIfString(values[i], strings[i]));\n }\n }\n }\n return results.join(\"\");\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import type { KeyCredential } from "@azure/core-auth";
2
+ import type { PipelinePolicy } from "@azure/core-rest-pipeline";
3
+ /**
4
+ * The programmatic identifier of the webPubSubKeyCredentialPolicy.
5
+ */
6
+ export declare const webPubSubKeyCredentialPolicyName = "webPubSubKeyCredentialPolicy";
7
+ /**
8
+ * Create an HTTP pipeline policy to authenticate a request
9
+ * using an `AzureKeyCredential` for Text Analytics
10
+ * @internal
11
+ */
12
+ export declare function webPubSubKeyCredentialPolicy(credential: KeyCredential): PipelinePolicy;
13
+ //# sourceMappingURL=webPubSubCredentialPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webPubSubCredentialPolicy.d.ts","sourceRoot":"","sources":["../../src/webPubSubCredentialPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAIV,cAAc,EACf,MAAM,2BAA2B,CAAC;AAInC;;GAEG;AACH,eAAO,MAAM,gCAAgC,iCAAiC,CAAC;AAE/E;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,aAAa,GAAG,cAAc,CAatF"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.webPubSubKeyCredentialPolicyName = void 0;
6
+ exports.webPubSubKeyCredentialPolicy = webPubSubKeyCredentialPolicy;
7
+ const tslib_1 = require("tslib");
8
+ const jsonwebtoken_1 = tslib_1.__importDefault(require("jsonwebtoken"));
9
+ /**
10
+ * The programmatic identifier of the webPubSubKeyCredentialPolicy.
11
+ */
12
+ exports.webPubSubKeyCredentialPolicyName = "webPubSubKeyCredentialPolicy";
13
+ /**
14
+ * Create an HTTP pipeline policy to authenticate a request
15
+ * using an `AzureKeyCredential` for Text Analytics
16
+ * @internal
17
+ */
18
+ function webPubSubKeyCredentialPolicy(credential) {
19
+ return {
20
+ name: exports.webPubSubKeyCredentialPolicyName,
21
+ sendRequest(request, next) {
22
+ const bearerToken = jsonwebtoken_1.default.sign({}, credential.key, {
23
+ audience: request.url,
24
+ expiresIn: "1h",
25
+ algorithm: "HS256",
26
+ });
27
+ request.headers.set("Authorization", `Bearer ${bearerToken}`);
28
+ return next(request);
29
+ },
30
+ };
31
+ }
32
+ //# sourceMappingURL=webPubSubCredentialPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webPubSubCredentialPolicy.js","sourceRoot":"","sources":["../../src/webPubSubCredentialPolicy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAsBlC,oEAaC;;AAzBD,wEAA+B;AAE/B;;GAEG;AACU,QAAA,gCAAgC,GAAG,8BAA8B,CAAC;AAE/E;;;;GAIG;AACH,SAAgB,4BAA4B,CAAC,UAAyB;IACpE,OAAO;QACL,IAAI,EAAE,wCAAgC;QACtC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YACrD,MAAM,WAAW,GAAG,sBAAG,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,GAAG,EAAE;gBAC/C,QAAQ,EAAE,OAAO,CAAC,GAAG;gBACrB,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,OAAO;aACnB,CAAC,CAAC;YACH,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,WAAW,EAAE,CAAC,CAAC;YAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { KeyCredential } from \"@azure/core-auth\";\nimport type {\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"]}
@@ -0,0 +1,19 @@
1
+ import * as coreClient from "@azure/core-client";
2
+ import { HealthApi, WebPubSub } from "./operationsInterfaces/index.js";
3
+ import { GeneratedClientOptionalParams } from "./models/index.js";
4
+ /** @internal */
5
+ export declare class GeneratedClient extends coreClient.ServiceClient {
6
+ endpoint: string;
7
+ apiVersion: string;
8
+ /**
9
+ * Initializes a new instance of the GeneratedClient class.
10
+ * @param endpoint HTTP or HTTPS endpoint for the Web PubSub service instance.
11
+ * @param options The parameter options
12
+ */
13
+ constructor(endpoint: string, options?: GeneratedClientOptionalParams);
14
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
15
+ private addCustomApiVersionPolicy;
16
+ healthApi: HealthApi;
17
+ webPubSub: WebPubSub;
18
+ }
19
+ //# sourceMappingURL=generatedClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatedClient.d.ts","sourceRoot":"","sources":["../../../src/generated/generatedClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAOjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAElE,gBAAgB;AAChB,qBAAa,eAAgB,SAAQ,UAAU,CAAC,aAAa;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;gBACS,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,6BAA6B;IAsCrE,8GAA8G;IAC9G,OAAO,CAAC,yBAAyB;IA2BjC,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,SAAS,CAAC;CACtB"}
@@ -6,7 +6,7 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
  import * as coreClient from "@azure/core-client";
9
- import { HealthApiImpl, WebPubSubImpl } from "./operations";
9
+ import { HealthApiImpl, WebPubSubImpl } from "./operations/index.js";
10
10
  /** @internal */
11
11
  export class GeneratedClient extends coreClient.ServiceClient {
12
12
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatedClient.js","sourceRoot":"","sources":["../../../src/generated/generatedClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAIrE,gBAAgB;AAChB,MAAM,OAAO,eAAgB,SAAQ,UAAU,CAAC,aAAa;IAI3D;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAAuC;;QACnE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAkC;YAC9C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,2BAA2B,CAAC;QACnD,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,QAAQ,EAAE,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,YAAY,GAC9D,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,0CAA0C;QAC1C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,YAAY,CAAC;QACrD,IAAI,CAAC,SAAS,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,SAAS,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrD,CAAC;IAED,8GAA8G;IACtG,yBAAyB,CAAC,UAAmB;QACnD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QACD,MAAM,gBAAgB,GAAG;YACvB,IAAI,EAAE,wBAAwB;YAC9B,KAAK,CAAC,WAAW,CACf,OAAwB,EACxB,IAAiB;gBAEjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAIF","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\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { HealthApiImpl, WebPubSubImpl } from \"./operations/index.js\";\nimport { HealthApi, WebPubSub } from \"./operationsInterfaces/index.js\";\nimport { GeneratedClientOptionalParams } from \"./models/index.js\";\n\n/** @internal */\nexport class GeneratedClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\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 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.1.3`;\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 endpoint: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2024-01-01\";\n this.healthApi = new HealthApiImpl(this);\n this.webPubSub = new WebPubSubImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest,\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n healthApi: HealthApi;\n webPubSub: WebPubSub;\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import * as coreClient from "@azure/core-client";
2
+ import { GeneratedClientOptionalParams } from "./models/index.js";
3
+ /** @internal */
4
+ export declare class GeneratedClientContext extends coreClient.ServiceClient {
5
+ endpoint: string;
6
+ apiVersion: string;
7
+ /**
8
+ * Initializes a new instance of the GeneratedClientContext class.
9
+ * @param endpoint HTTP or HTTPS endpoint for the Web PubSub service instance.
10
+ * @param options The parameter options
11
+ */
12
+ constructor(endpoint: string, options?: GeneratedClientOptionalParams);
13
+ }
14
+ //# sourceMappingURL=generatedClientContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatedClientContext.d.ts","sourceRoot":"","sources":["../../../src/generated/generatedClientContext.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAElE,gBAAgB;AAChB,qBAAa,sBAAuB,SAAQ,UAAU,CAAC,aAAa;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;gBACS,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,6BAA6B;CAkCtE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatedClientContext.js","sourceRoot":"","sources":["../../../src/generated/generatedClientContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAGjD,gBAAgB;AAChB,MAAM,OAAO,sBAAuB,SAAQ,UAAU,CAAC,aAAa;IAIlE;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAAuC;QACnE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAkC;YAC9C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,2BAA2B,CAAC;QACnD,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,OAAO,EAAE,OAAO,CAAC,QAAQ,IAAI,YAAY,GAC1C,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,0CAA0C;QAC1C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,YAAY,CAAC;IACvD,CAAC;CACF","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\";\nimport { GeneratedClientOptionalParams } from \"./models/index.js\";\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.1.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"]}
@@ -0,0 +1,4 @@
1
+ export * from "./models/index.js";
2
+ export { GeneratedClient } from "./generatedClient.js";
3
+ export * from "./operationsInterfaces/index.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAQA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,cAAc,iCAAiC,CAAC"}
@@ -5,7 +5,7 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- export * from "./models";
9
- export { GeneratedClient } from "./generatedClient";
10
- export * from "./operationsInterfaces";
8
+ export * from "./models/index.js";
9
+ export { GeneratedClient } from "./generatedClient.js";
10
+ export * from "./operationsInterfaces/index.js";
11
11
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,cAAc,iCAAiC,CAAC","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\nexport * from \"./models/index.js\";\nexport { GeneratedClient } from \"./generatedClient.js\";\nexport * from \"./operationsInterfaces/index.js\";\n"]}
@@ -0,0 +1,323 @@
1
+ import * as coreClient from "@azure/core-client";
2
+ /** The request object containing targets groups and a connection filter */
3
+ export interface AddToGroupsRequest {
4
+ /** A list of groups which target connections will be added into */
5
+ groups?: string[];
6
+ /** An OData filter which target connections satisfy */
7
+ filter?: string;
8
+ }
9
+ /** The error object. */
10
+ export interface ErrorDetail {
11
+ /** One of a server-defined set of error codes. */
12
+ code?: string;
13
+ /** A human-readable representation of the error. */
14
+ message?: string;
15
+ /** The target of the error. */
16
+ target?: string;
17
+ /** An array of details about specific errors that led to this reported error. */
18
+ details?: ErrorDetail[];
19
+ inner?: InnerError;
20
+ }
21
+ export interface InnerError {
22
+ /** A more specific error code than was provided by the containing error. */
23
+ code?: string;
24
+ inner?: InnerError;
25
+ }
26
+ /** The response object containing the token for the client */
27
+ export interface ClientTokenResponse {
28
+ /** The token value for the WebSocket client to connect to the service */
29
+ token?: string;
30
+ }
31
+ /** The request object containing targets groups and a connection filter */
32
+ export interface RemoveFromGroupsRequest {
33
+ /** A list of groups which target connections will be removed from */
34
+ groups?: string[];
35
+ /** An OData filter which target connections satisfy */
36
+ filter?: string;
37
+ }
38
+ /** Defines headers for WebPubSub_addConnectionsToGroups operation. */
39
+ export interface WebPubSubAddConnectionsToGroupsExceptionHeaders {
40
+ errorCode?: string;
41
+ }
42
+ /** Defines headers for WebPubSub_closeAllConnections operation. */
43
+ export interface WebPubSubCloseAllConnectionsExceptionHeaders {
44
+ errorCode?: string;
45
+ }
46
+ /** Defines headers for WebPubSub_generateClientToken operation. */
47
+ export interface WebPubSubGenerateClientTokenExceptionHeaders {
48
+ errorCode?: string;
49
+ }
50
+ /** Defines headers for WebPubSub_removeConnectionsFromGroups operation. */
51
+ export interface WebPubSubRemoveConnectionsFromGroupsExceptionHeaders {
52
+ errorCode?: string;
53
+ }
54
+ /** Defines headers for WebPubSub_sendToAll operation. */
55
+ export interface WebPubSubSendToAllExceptionHeaders {
56
+ errorCode?: string;
57
+ }
58
+ /** Defines headers for WebPubSub_closeConnection operation. */
59
+ export interface WebPubSubCloseConnectionExceptionHeaders {
60
+ errorCode?: string;
61
+ }
62
+ /** Defines headers for WebPubSub_connectionExists operation. */
63
+ export interface WebPubSubConnectionExistsExceptionHeaders {
64
+ errorCode?: string;
65
+ }
66
+ /** Defines headers for WebPubSub_sendToConnection operation. */
67
+ export interface WebPubSubSendToConnectionExceptionHeaders {
68
+ errorCode?: string;
69
+ }
70
+ /** Defines headers for WebPubSub_removeConnectionFromAllGroups operation. */
71
+ export interface WebPubSubRemoveConnectionFromAllGroupsExceptionHeaders {
72
+ errorCode?: string;
73
+ }
74
+ /** Defines headers for WebPubSub_groupExists operation. */
75
+ export interface WebPubSubGroupExistsExceptionHeaders {
76
+ errorCode?: string;
77
+ }
78
+ /** Defines headers for WebPubSub_closeGroupConnections operation. */
79
+ export interface WebPubSubCloseGroupConnectionsExceptionHeaders {
80
+ errorCode?: string;
81
+ }
82
+ /** Defines headers for WebPubSub_sendToGroup operation. */
83
+ export interface WebPubSubSendToGroupExceptionHeaders {
84
+ errorCode?: string;
85
+ }
86
+ /** Defines headers for WebPubSub_removeConnectionFromGroup operation. */
87
+ export interface WebPubSubRemoveConnectionFromGroupExceptionHeaders {
88
+ errorCode?: string;
89
+ }
90
+ /** Defines headers for WebPubSub_addConnectionToGroup operation. */
91
+ export interface WebPubSubAddConnectionToGroupExceptionHeaders {
92
+ errorCode?: string;
93
+ }
94
+ /** Defines headers for WebPubSub_revokePermission operation. */
95
+ export interface WebPubSubRevokePermissionExceptionHeaders {
96
+ errorCode?: string;
97
+ }
98
+ /** Defines headers for WebPubSub_checkPermission operation. */
99
+ export interface WebPubSubCheckPermissionExceptionHeaders {
100
+ errorCode?: string;
101
+ }
102
+ /** Defines headers for WebPubSub_grantPermission operation. */
103
+ export interface WebPubSubGrantPermissionExceptionHeaders {
104
+ errorCode?: string;
105
+ }
106
+ /** Defines headers for WebPubSub_userExists operation. */
107
+ export interface WebPubSubUserExistsExceptionHeaders {
108
+ errorCode?: string;
109
+ }
110
+ /** Defines headers for WebPubSub_closeUserConnections operation. */
111
+ export interface WebPubSubCloseUserConnectionsExceptionHeaders {
112
+ errorCode?: string;
113
+ }
114
+ /** Defines headers for WebPubSub_sendToUser operation. */
115
+ export interface WebPubSubSendToUserExceptionHeaders {
116
+ errorCode?: string;
117
+ }
118
+ /** Defines headers for WebPubSub_removeUserFromAllGroups operation. */
119
+ export interface WebPubSubRemoveUserFromAllGroupsExceptionHeaders {
120
+ errorCode?: string;
121
+ }
122
+ /** Defines headers for WebPubSub_removeUserFromGroup operation. */
123
+ export interface WebPubSubRemoveUserFromGroupExceptionHeaders {
124
+ errorCode?: string;
125
+ }
126
+ /** Defines headers for WebPubSub_addUserToGroup operation. */
127
+ export interface WebPubSubAddUserToGroupExceptionHeaders {
128
+ errorCode?: string;
129
+ }
130
+ /** Known values of {@link WebPubSubClientType} that the service accepts. */
131
+ export declare enum KnownWebPubSubClientType {
132
+ /** Default */
133
+ Default = "Default",
134
+ /** Mqtt */
135
+ Mqtt = "MQTT"
136
+ }
137
+ /**
138
+ * Defines values for WebPubSubClientType. \
139
+ * {@link KnownWebPubSubClientType} can be used interchangeably with WebPubSubClientType,
140
+ * this enum contains the known values that the service supports.
141
+ * ### Known values supported by the service
142
+ * **Default** \
143
+ * **MQTT**
144
+ */
145
+ export type WebPubSubClientType = string;
146
+ /** Known values of {@link WebPubSubPermission} that the service accepts. */
147
+ export declare enum KnownWebPubSubPermission {
148
+ /** SendToGroup */
149
+ SendToGroup = "sendToGroup",
150
+ /** JoinLeaveGroup */
151
+ JoinLeaveGroup = "joinLeaveGroup"
152
+ }
153
+ /**
154
+ * Defines values for WebPubSubPermission. \
155
+ * {@link KnownWebPubSubPermission} can be used interchangeably with WebPubSubPermission,
156
+ * this enum contains the known values that the service supports.
157
+ * ### Known values supported by the service
158
+ * **sendToGroup** \
159
+ * **joinLeaveGroup**
160
+ */
161
+ export type WebPubSubPermission = string;
162
+ /** Defines values for ContentType. */
163
+ export type ContentType = "application/json" | "application/octet-stream";
164
+ /** Optional parameters. */
165
+ export interface HealthApiGetServiceStatusOptionalParams extends coreClient.OperationOptions {
166
+ }
167
+ /** Optional parameters. */
168
+ export interface WebPubSubAddConnectionsToGroupsOptionalParams extends coreClient.OperationOptions {
169
+ }
170
+ /** Optional parameters. */
171
+ export interface WebPubSubCloseAllConnectionsOptionalParams extends coreClient.OperationOptions {
172
+ /** Exclude these connectionIds when closing the connections in the hub. */
173
+ excluded?: string[];
174
+ /** The reason closing the client connection. */
175
+ reason?: string;
176
+ }
177
+ /** Optional parameters. */
178
+ export interface WebPubSubGenerateClientTokenOptionalParams extends coreClient.OperationOptions {
179
+ /** User Id. */
180
+ userId?: string;
181
+ /** Roles that the connection with the generated token will have. */
182
+ roles?: string[];
183
+ /** The expire time of the generated token. */
184
+ expirationTimeInMinutes?: number;
185
+ /** Groups that the connection will join when it connects. */
186
+ groups?: string[];
187
+ /** The type of client. Case-insensitive. If not set, it's "Default". For Web PubSub for Socket.IO, only the default value is supported. For Web PubSub, the valid values are 'Default' and 'MQTT'. */
188
+ clientType?: WebPubSubClientType;
189
+ }
190
+ /** Contains response data for the generateClientToken operation. */
191
+ export type WebPubSubGenerateClientTokenResponse = ClientTokenResponse;
192
+ /** Optional parameters. */
193
+ export interface WebPubSubRemoveConnectionsFromGroupsOptionalParams extends coreClient.OperationOptions {
194
+ }
195
+ /** Optional parameters. */
196
+ export interface WebPubSubSendToAll$binaryOptionalParams extends coreClient.OperationOptions {
197
+ /** Excluded connection Ids. */
198
+ excludedConnections?: string[];
199
+ /** Following OData filter syntax to filter out the subscribers receiving the messages. */
200
+ filter?: string;
201
+ /** The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited. */
202
+ messageTtlSeconds?: number;
203
+ }
204
+ /** Optional parameters. */
205
+ export interface WebPubSubSendToAll$textOptionalParams extends coreClient.OperationOptions {
206
+ /** Excluded connection Ids. */
207
+ excludedConnections?: string[];
208
+ /** Following OData filter syntax to filter out the subscribers receiving the messages. */
209
+ filter?: string;
210
+ /** The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited. */
211
+ messageTtlSeconds?: number;
212
+ }
213
+ /** Optional parameters. */
214
+ export interface WebPubSubCloseConnectionOptionalParams extends coreClient.OperationOptions {
215
+ /** The reason closing the client connection. */
216
+ reason?: string;
217
+ }
218
+ /** Optional parameters. */
219
+ export interface WebPubSubConnectionExistsOptionalParams extends coreClient.OperationOptions {
220
+ }
221
+ /** Optional parameters. */
222
+ export interface WebPubSubSendToConnection$binaryOptionalParams extends coreClient.OperationOptions {
223
+ /** The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited. */
224
+ messageTtlSeconds?: number;
225
+ }
226
+ /** Optional parameters. */
227
+ export interface WebPubSubSendToConnection$textOptionalParams extends coreClient.OperationOptions {
228
+ /** The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited. */
229
+ messageTtlSeconds?: number;
230
+ }
231
+ /** Optional parameters. */
232
+ export interface WebPubSubRemoveConnectionFromAllGroupsOptionalParams extends coreClient.OperationOptions {
233
+ }
234
+ /** Optional parameters. */
235
+ export interface WebPubSubGroupExistsOptionalParams extends coreClient.OperationOptions {
236
+ }
237
+ /** Optional parameters. */
238
+ export interface WebPubSubCloseGroupConnectionsOptionalParams extends coreClient.OperationOptions {
239
+ /** Exclude these connectionIds when closing the connections in the group. */
240
+ excluded?: string[];
241
+ /** The reason closing the client connection. */
242
+ reason?: string;
243
+ }
244
+ /** Optional parameters. */
245
+ export interface WebPubSubSendToGroup$binaryOptionalParams extends coreClient.OperationOptions {
246
+ /** Excluded connection Ids */
247
+ excludedConnections?: string[];
248
+ /** Following OData filter syntax to filter out the subscribers receiving the messages. */
249
+ filter?: string;
250
+ /** The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited. */
251
+ messageTtlSeconds?: number;
252
+ }
253
+ /** Optional parameters. */
254
+ export interface WebPubSubSendToGroup$textOptionalParams extends coreClient.OperationOptions {
255
+ /** Excluded connection Ids */
256
+ excludedConnections?: string[];
257
+ /** Following OData filter syntax to filter out the subscribers receiving the messages. */
258
+ filter?: string;
259
+ /** The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited. */
260
+ messageTtlSeconds?: number;
261
+ }
262
+ /** Optional parameters. */
263
+ export interface WebPubSubRemoveConnectionFromGroupOptionalParams extends coreClient.OperationOptions {
264
+ }
265
+ /** Optional parameters. */
266
+ export interface WebPubSubAddConnectionToGroupOptionalParams extends coreClient.OperationOptions {
267
+ }
268
+ /** Optional parameters. */
269
+ export interface WebPubSubRevokePermissionOptionalParams extends coreClient.OperationOptions {
270
+ /** The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name. */
271
+ targetName?: string;
272
+ }
273
+ /** Optional parameters. */
274
+ export interface WebPubSubCheckPermissionOptionalParams extends coreClient.OperationOptions {
275
+ /** The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name. */
276
+ targetName?: string;
277
+ }
278
+ /** Optional parameters. */
279
+ export interface WebPubSubGrantPermissionOptionalParams extends coreClient.OperationOptions {
280
+ /** The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name. */
281
+ targetName?: string;
282
+ }
283
+ /** Optional parameters. */
284
+ export interface WebPubSubUserExistsOptionalParams extends coreClient.OperationOptions {
285
+ }
286
+ /** Optional parameters. */
287
+ export interface WebPubSubCloseUserConnectionsOptionalParams extends coreClient.OperationOptions {
288
+ /** Exclude these connectionIds when closing the connections for the user. */
289
+ excluded?: string[];
290
+ /** The reason closing the client connection. */
291
+ reason?: string;
292
+ }
293
+ /** Optional parameters. */
294
+ export interface WebPubSubSendToUser$binaryOptionalParams extends coreClient.OperationOptions {
295
+ /** Following OData filter syntax to filter out the subscribers receiving the messages. */
296
+ filter?: string;
297
+ /** The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited. */
298
+ messageTtlSeconds?: number;
299
+ }
300
+ /** Optional parameters. */
301
+ export interface WebPubSubSendToUser$textOptionalParams extends coreClient.OperationOptions {
302
+ /** Following OData filter syntax to filter out the subscribers receiving the messages. */
303
+ filter?: string;
304
+ /** The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited. */
305
+ messageTtlSeconds?: number;
306
+ }
307
+ /** Optional parameters. */
308
+ export interface WebPubSubRemoveUserFromAllGroupsOptionalParams extends coreClient.OperationOptions {
309
+ }
310
+ /** Optional parameters. */
311
+ export interface WebPubSubRemoveUserFromGroupOptionalParams extends coreClient.OperationOptions {
312
+ }
313
+ /** Optional parameters. */
314
+ export interface WebPubSubAddUserToGroupOptionalParams extends coreClient.OperationOptions {
315
+ }
316
+ /** Optional parameters. */
317
+ export interface GeneratedClientOptionalParams extends coreClient.ServiceClientOptions {
318
+ /** Api Version */
319
+ apiVersion?: string;
320
+ /** Overrides client endpoint. */
321
+ endpoint?: string;
322
+ }
323
+ //# sourceMappingURL=index.d.ts.map