@azure/web-pubsub 1.0.0-beta.2 → 1.0.1-alpha.20211215.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +118 -31
  3. package/dist/index.js +1315 -567
  4. package/dist/index.js.map +1 -1
  5. package/dist-esm/samples-dev/broadcasting.js +16 -16
  6. package/dist-esm/samples-dev/broadcasting.js.map +1 -1
  7. package/dist-esm/samples-dev/directMessage.js +9 -9
  8. package/dist-esm/samples-dev/directMessage.js.map +1 -1
  9. package/dist-esm/samples-dev/managingGroups.js +11 -12
  10. package/dist-esm/samples-dev/managingGroups.js.map +1 -1
  11. package/dist-esm/src/generated/generatedClient.js +23 -0
  12. package/dist-esm/src/generated/generatedClient.js.map +1 -0
  13. package/dist-esm/src/generated/generatedClientContext.js +41 -0
  14. package/dist-esm/src/generated/generatedClientContext.js.map +1 -0
  15. package/dist-esm/src/generated/index.js +10 -2
  16. package/dist-esm/src/generated/index.js.map +1 -1
  17. package/dist-esm/src/generated/models/index.js +13 -1
  18. package/dist-esm/src/generated/models/index.js.map +1 -1
  19. package/dist-esm/src/generated/models/mappers.js +368 -0
  20. package/dist-esm/src/generated/models/mappers.js.map +1 -0
  21. package/dist-esm/src/generated/models/parameters.js +124 -43
  22. package/dist-esm/src/generated/models/parameters.js.map +1 -1
  23. package/dist-esm/src/generated/operations/healthApi.js +16 -11
  24. package/dist-esm/src/generated/operations/healthApi.js.map +1 -1
  25. package/dist-esm/src/generated/operations/index.js +7 -0
  26. package/dist-esm/src/generated/operations/index.js.map +1 -1
  27. package/dist-esm/src/generated/operations/webPubSub.js +341 -175
  28. package/dist-esm/src/generated/operations/webPubSub.js.map +1 -1
  29. package/dist-esm/src/generated/operationsInterfaces/healthApi.js +9 -0
  30. package/dist-esm/src/generated/operationsInterfaces/healthApi.js.map +1 -0
  31. package/dist-esm/src/generated/operationsInterfaces/index.js +10 -0
  32. package/dist-esm/src/generated/operationsInterfaces/index.js.map +1 -0
  33. package/dist-esm/src/generated/operationsInterfaces/webPubSub.js +9 -0
  34. package/dist-esm/src/generated/operationsInterfaces/webPubSub.js.map +1 -0
  35. package/dist-esm/src/groupClient.js +74 -92
  36. package/dist-esm/src/groupClient.js.map +1 -1
  37. package/dist-esm/src/hubClient.js +280 -196
  38. package/dist-esm/src/hubClient.js.map +1 -1
  39. package/dist-esm/src/index.js.map +1 -1
  40. package/dist-esm/src/logger.js +1 -1
  41. package/dist-esm/src/logger.js.map +1 -1
  42. package/dist-esm/src/parseConnectionString.js +3 -1
  43. package/dist-esm/src/parseConnectionString.js.map +1 -1
  44. package/dist-esm/src/reverseProxyPolicy.js +21 -0
  45. package/dist-esm/src/reverseProxyPolicy.js.map +1 -0
  46. package/dist-esm/src/utils.js +8 -6
  47. package/dist-esm/src/utils.js.map +1 -1
  48. package/dist-esm/src/webPubSubCredentialPolicy.js +18 -18
  49. package/dist-esm/src/webPubSubCredentialPolicy.js.map +1 -1
  50. package/dist-esm/test/conn.spec.js +7 -8
  51. package/dist-esm/test/conn.spec.js.map +1 -1
  52. package/dist-esm/test/groups.spec.js +39 -38
  53. package/dist-esm/test/groups.spec.js.map +1 -1
  54. package/dist-esm/test/hubs.spec.js +95 -49
  55. package/dist-esm/test/hubs.spec.js.map +1 -1
  56. package/dist-esm/test/integration.spec.js +128 -0
  57. package/dist-esm/test/integration.spec.js.map +1 -0
  58. package/dist-esm/test/testEnv.js +5 -1
  59. package/dist-esm/test/testEnv.js.map +1 -1
  60. package/package.json +37 -36
  61. package/types/web-pubsub.d.ts +186 -138
  62. package/dist-esm/src/generated/azureWebPubSubServiceRestAPI.js +0 -15
  63. package/dist-esm/src/generated/azureWebPubSubServiceRestAPI.js.map +0 -1
  64. package/dist-esm/src/generated/azureWebPubSubServiceRestAPIContext.js +0 -34
  65. package/dist-esm/src/generated/azureWebPubSubServiceRestAPIContext.js.map +0 -1
  66. package/dist-esm/src/normalizeOptions.js +0 -8
  67. package/dist-esm/src/normalizeOptions.js.map +0 -1
@@ -1,7 +1,15 @@
1
- import * as coreHttp from "@azure/core-http";
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+ import * as coreClient from "@azure/core-client";
9
+ import * as Mappers from "../models/mappers";
2
10
  import * as Parameters from "../models/parameters";
3
- /** Class representing a HealthApi. */
4
- export class HealthApi {
11
+ /** Class containing HealthApi operations. */
12
+ export class HealthApiImpl {
5
13
  /**
6
14
  * Initialize a new instance of the class HealthApi class.
7
15
  * @param client Reference to the service client
@@ -13,21 +21,18 @@ export class HealthApi {
13
21
  * Get service health status.
14
22
  * @param options The options parameters.
15
23
  */
16
- getHealthStatus(options) {
17
- const operationArguments = {
18
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
19
- };
20
- return this.client.sendOperationRequest(operationArguments, getHealthStatusOperationSpec);
24
+ getServiceStatus(options) {
25
+ return this.client.sendOperationRequest({ options }, getServiceStatusOperationSpec);
21
26
  }
22
27
  }
23
28
  // Operation Specifications
24
- const serializer = new coreHttp.Serializer({}, /* isXml */ false);
25
- const getHealthStatusOperationSpec = {
29
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
30
+ const getServiceStatusOperationSpec = {
26
31
  path: "/api/health",
27
32
  httpMethod: "HEAD",
28
33
  responses: { 200: {}, default: {} },
29
34
  queryParameters: [Parameters.apiVersion],
30
- urlParameters: [Parameters.$host],
35
+ urlParameters: [Parameters.endpoint],
31
36
  serializer
32
37
  };
33
38
  //# sourceMappingURL=healthApi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"healthApi.js","sourceRoot":"","sources":["../../../../src/generated/operations/healthApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AAGnD,sCAAsC;AACtC,MAAM,OAAO,SAAS;IAGpB;;;OAGG;IACH,YAAY,MAA2C;QACrD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,eAAe,CACb,OAAmC;QAEnC,MAAM,kBAAkB,GAAgC;YACtD,OAAO,EAAE,QAAQ,CAAC,oCAAoC,CAAC,OAAO,IAAI,EAAE,CAAC;SACtE,CAAC;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,kBAAkB,EAClB,4BAA4B,CACK,CAAC;IACtC,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAC,UAAU,CAAC,EAAE,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAElE,MAAM,4BAA4B,GAA2B;IAC3D,IAAI,EAAE,aAAa;IACnB,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IACnC,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;IACjC,UAAU;CACX,CAAC","sourcesContent":["import * as coreHttp from \"@azure/core-http\";\nimport * as Parameters from \"../models/parameters\";\nimport { AzureWebPubSubServiceRestAPIContext } from \"../azureWebPubSubServiceRestAPIContext\";\n\n/** Class representing a HealthApi. */\nexport class HealthApi {\n private readonly client: AzureWebPubSubServiceRestAPIContext;\n\n /**\n * Initialize a new instance of the class HealthApi class.\n * @param client Reference to the service client\n */\n constructor(client: AzureWebPubSubServiceRestAPIContext) {\n this.client = client;\n }\n\n /**\n * Get service health status.\n * @param options The options parameters.\n */\n getHealthStatus(\n options?: coreHttp.OperationOptions\n ): Promise<coreHttp.RestResponse> {\n const operationArguments: coreHttp.OperationArguments = {\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(\n operationArguments,\n getHealthStatusOperationSpec\n ) as Promise<coreHttp.RestResponse>;\n }\n}\n// Operation Specifications\nconst serializer = new coreHttp.Serializer({}, /* isXml */ false);\n\nconst getHealthStatusOperationSpec: coreHttp.OperationSpec = {\n path: \"/api/health\",\n httpMethod: \"HEAD\",\n responses: { 200: {}, default: {} },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host],\n serializer\n};\n"]}
1
+ {"version":3,"file":"healthApi.js","sourceRoot":"","sources":["../../../../src/generated/operations/healthApi.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AAInD,6CAA6C;AAC7C,MAAM,OAAO,aAAa;IAGxB;;;OAGG;IACH,YAAY,MAA8B;QACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,gBAAgB,CACd,OAAiD;QAEjD,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,OAAO,EAAE,EACX,6BAA6B,CAC9B,CAAC;IACJ,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,6BAA6B,GAA6B;IAC9D,IAAI,EAAE,aAAa;IACnB,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IACnC,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,UAAU;CACX,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\nimport { HealthApi } from \"../operationsInterfaces\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers\";\nimport * as Parameters from \"../models/parameters\";\nimport { GeneratedClientContext } from \"../generatedClientContext\";\nimport { HealthApiGetServiceStatusOptionalParams } from \"../models\";\n\n/** Class containing HealthApi operations. */\nexport class HealthApiImpl implements HealthApi {\n private readonly client: GeneratedClientContext;\n\n /**\n * Initialize a new instance of the class HealthApi class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClientContext) {\n this.client = client;\n }\n\n /**\n * Get service health status.\n * @param options The options parameters.\n */\n getServiceStatus(\n options?: HealthApiGetServiceStatusOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { options },\n getServiceStatusOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getServiceStatusOperationSpec: coreClient.OperationSpec = {\n path: \"/api/health\",\n httpMethod: \"HEAD\",\n responses: { 200: {}, default: {} },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n serializer\n};\n"]}
@@ -1,3 +1,10 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
1
8
  export * from "./healthApi";
2
9
  export * from "./webPubSub";
3
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generated/operations/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC","sourcesContent":["export * from \"./healthApi\";\nexport * from \"./webPubSub\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generated/operations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,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 \"./healthApi\";\nexport * from \"./webPubSub\";\n"]}