@azure/arm-healthbot 2.0.1-alpha.20220412.1 → 2.0.1-alpha.20220427.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +3 -7
  2. package/README.md +11 -0
  3. package/dist/index.js +70 -25
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/dist-esm/samples-dev/botsCreateSample.d.ts +2 -0
  8. package/dist-esm/samples-dev/botsCreateSample.d.ts.map +1 -0
  9. package/dist-esm/samples-dev/botsCreateSample.js +42 -0
  10. package/dist-esm/samples-dev/botsCreateSample.js.map +1 -0
  11. package/dist-esm/samples-dev/botsDeleteSample.d.ts +2 -0
  12. package/dist-esm/samples-dev/botsDeleteSample.d.ts.map +1 -0
  13. package/dist-esm/samples-dev/botsDeleteSample.js +31 -0
  14. package/dist-esm/samples-dev/botsDeleteSample.js.map +1 -0
  15. package/dist-esm/samples-dev/botsGetSample.d.ts +2 -0
  16. package/dist-esm/samples-dev/botsGetSample.d.ts.map +1 -0
  17. package/dist-esm/samples-dev/botsGetSample.js +31 -0
  18. package/dist-esm/samples-dev/botsGetSample.js.map +1 -0
  19. package/dist-esm/samples-dev/botsListByResourceGroupSample.d.ts +2 -0
  20. package/dist-esm/samples-dev/botsListByResourceGroupSample.d.ts.map +1 -0
  21. package/dist-esm/samples-dev/botsListByResourceGroupSample.js +44 -0
  22. package/dist-esm/samples-dev/botsListByResourceGroupSample.js.map +1 -0
  23. package/dist-esm/samples-dev/botsListSample.d.ts +2 -0
  24. package/dist-esm/samples-dev/botsListSample.d.ts.map +1 -0
  25. package/dist-esm/samples-dev/botsListSample.js +43 -0
  26. package/dist-esm/samples-dev/botsListSample.js.map +1 -0
  27. package/dist-esm/samples-dev/botsUpdateSample.d.ts +2 -0
  28. package/dist-esm/samples-dev/botsUpdateSample.d.ts.map +1 -0
  29. package/dist-esm/samples-dev/botsUpdateSample.js +32 -0
  30. package/dist-esm/samples-dev/botsUpdateSample.js.map +1 -0
  31. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  32. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  33. package/dist-esm/samples-dev/operationsListSample.js +43 -0
  34. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  35. package/dist-esm/src/healthbotClient.d.ts.map +1 -1
  36. package/dist-esm/src/healthbotClient.js +20 -2
  37. package/dist-esm/src/healthbotClient.js.map +1 -1
  38. package/dist-esm/src/operations/bots.d.ts.map +1 -1
  39. package/dist-esm/src/operations/bots.js +6 -2
  40. package/dist-esm/src/operations/bots.js.map +1 -1
  41. package/package.json +27 -11
  42. package/rollup.config.js +6 -72
  43. package/src/healthbotClient.ts +27 -2
  44. package/src/operations/bots.ts +6 -2
  45. package/tsconfig.json +19 -5
  46. package/types/tsdoc-metadata.json +1 -1
  47. package/LICENSE.txt +0 -21
package/CHANGELOG.md CHANGED
@@ -1,14 +1,10 @@
1
1
  # Release History
2
2
 
3
- ## 2.0.1 (Unreleased)
3
+ ## 2.0.1 (2022-04-26)
4
4
 
5
- ### Features Added
5
+ **Features**
6
6
 
7
- ### Breaking Changes
8
-
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
7
+ - Bug fix
12
8
 
13
9
  ## 2.0.0 (2022-01-13)
14
10
 
package/README.md CHANGED
@@ -16,6 +16,8 @@ Azure Health Bot is a cloud platform that empowers developers in Healthcare orga
16
16
  - [LTS versions of Node.js](https://nodejs.org/about/releases/)
17
17
  - Latest versions of Safari, Chrome, Edge and Firefox.
18
18
 
19
+ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
20
+
19
21
  ### Prerequisites
20
22
 
21
23
  - An [Azure subscription][azure_sub].
@@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this
49
51
  ```javascript
50
52
  const { HealthbotClient } = require("@azure/arm-healthbot");
51
53
  const { DefaultAzureCredential } = require("@azure/identity");
54
+ // For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
55
+
52
56
  const subscriptionId = "00000000-0000-0000-0000-000000000000";
53
57
  const client = new HealthbotClient(new DefaultAzureCredential(), subscriptionId);
58
+
59
+ // For client-side applications running in the browser, use this code instead:
60
+ // const credential = new InteractiveBrowserCredential({
61
+ // tenantId: "<YOUR_TENANT_ID>",
62
+ // clientId: "<YOUR_CLIENT_ID>"
63
+ // });
64
+ // const client = new HealthbotClient(credential, subscriptionId);
54
65
  ```
55
66
 
56
67
 
package/dist/index.js CHANGED
@@ -3,9 +3,31 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var coreClient = require('@azure/core-client');
6
+ var coreRestPipeline = require('@azure/core-rest-pipeline');
6
7
  var tslib = require('tslib');
7
8
  var coreLro = require('@azure/core-lro');
8
9
 
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n["default"] = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
29
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
30
+
9
31
  /*
10
32
  * Copyright (c) Microsoft Corporation.
11
33
  * Licensed under the MIT License.
@@ -13,6 +35,8 @@ var coreLro = require('@azure/core-lro');
13
35
  * Code generated by Microsoft (R) AutoRest Code Generator.
14
36
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
15
37
  */
38
+ /** Known values of {@link IdentityType} that the service accepts. */
39
+ exports.KnownIdentityType = void 0;
16
40
  (function (KnownIdentityType) {
17
41
  KnownIdentityType["User"] = "User";
18
42
  KnownIdentityType["Application"] = "Application";
@@ -829,11 +853,13 @@ class BotsImpl {
829
853
  };
830
854
  });
831
855
  const lro = new LroImpl(sendOperation, { resourceGroupName, botName, parameters, options }, createOperationSpec);
832
- return new coreLro.LroEngine(lro, {
856
+ const poller = new coreLro.LroEngine(lro, {
833
857
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
834
858
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
835
859
  lroResourceLocationConfig: "azure-async-operation"
836
860
  });
861
+ yield poller.poll();
862
+ return poller;
837
863
  });
838
864
  }
839
865
  /**
@@ -899,10 +925,12 @@ class BotsImpl {
899
925
  };
900
926
  });
901
927
  const lro = new LroImpl(sendOperation, { resourceGroupName, botName, options }, deleteOperationSpec);
902
- return new coreLro.LroEngine(lro, {
928
+ const poller = new coreLro.LroEngine(lro, {
903
929
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
904
930
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
905
931
  });
932
+ yield poller.poll();
933
+ return poller;
906
934
  });
907
935
  }
908
936
  /**
@@ -930,7 +958,7 @@ class BotsImpl {
930
958
  * @param options The options parameters.
931
959
  */
932
960
  _list(options) {
933
- return this.client.sendOperationRequest({ options }, listOperationSpec);
961
+ return this.client.sendOperationRequest({ options }, listOperationSpec$1);
934
962
  }
935
963
  /**
936
964
  * ListByResourceGroupNext
@@ -947,11 +975,11 @@ class BotsImpl {
947
975
  * @param options The options parameters.
948
976
  */
949
977
  _listNext(nextLink, options) {
950
- return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
978
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$1);
951
979
  }
952
980
  }
953
981
  // Operation Specifications
954
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
982
+ const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
955
983
  const createOperationSpec = {
956
984
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}",
957
985
  httpMethod: "PUT",
@@ -982,7 +1010,7 @@ const createOperationSpec = {
982
1010
  ],
983
1011
  headerParameters: [contentType, accept],
984
1012
  mediaType: "json",
985
- serializer
1013
+ serializer: serializer$1
986
1014
  };
987
1015
  const getOperationSpec = {
988
1016
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}",
@@ -1003,7 +1031,7 @@ const getOperationSpec = {
1003
1031
  botName
1004
1032
  ],
1005
1033
  headerParameters: [accept],
1006
- serializer
1034
+ serializer: serializer$1
1007
1035
  };
1008
1036
  const updateOperationSpec = {
1009
1037
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}",
@@ -1029,7 +1057,7 @@ const updateOperationSpec = {
1029
1057
  ],
1030
1058
  headerParameters: [contentType, accept],
1031
1059
  mediaType: "json",
1032
- serializer
1060
+ serializer: serializer$1
1033
1061
  };
1034
1062
  const deleteOperationSpec = {
1035
1063
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}",
@@ -1051,7 +1079,7 @@ const deleteOperationSpec = {
1051
1079
  botName
1052
1080
  ],
1053
1081
  headerParameters: [accept],
1054
- serializer
1082
+ serializer: serializer$1
1055
1083
  };
1056
1084
  const listByResourceGroupOperationSpec = {
1057
1085
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots",
@@ -1071,9 +1099,9 @@ const listByResourceGroupOperationSpec = {
1071
1099
  resourceGroupName
1072
1100
  ],
1073
1101
  headerParameters: [accept],
1074
- serializer
1102
+ serializer: serializer$1
1075
1103
  };
1076
- const listOperationSpec = {
1104
+ const listOperationSpec$1 = {
1077
1105
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.HealthBot/healthBots",
1078
1106
  httpMethod: "GET",
1079
1107
  responses: {
@@ -1087,7 +1115,7 @@ const listOperationSpec = {
1087
1115
  queryParameters: [apiVersion],
1088
1116
  urlParameters: [$host, subscriptionId],
1089
1117
  headerParameters: [accept],
1090
- serializer
1118
+ serializer: serializer$1
1091
1119
  };
1092
1120
  const listByResourceGroupNextOperationSpec = {
1093
1121
  path: "{nextLink}",
@@ -1108,9 +1136,9 @@ const listByResourceGroupNextOperationSpec = {
1108
1136
  nextLink
1109
1137
  ],
1110
1138
  headerParameters: [accept],
1111
- serializer
1139
+ serializer: serializer$1
1112
1140
  };
1113
- const listNextOperationSpec = {
1141
+ const listNextOperationSpec$1 = {
1114
1142
  path: "{nextLink}",
1115
1143
  httpMethod: "GET",
1116
1144
  responses: {
@@ -1128,7 +1156,7 @@ const listNextOperationSpec = {
1128
1156
  nextLink
1129
1157
  ],
1130
1158
  headerParameters: [accept],
1131
- serializer
1159
+ serializer: serializer$1
1132
1160
  };
1133
1161
 
1134
1162
  /*
@@ -1201,7 +1229,7 @@ class OperationsImpl {
1201
1229
  * @param options The options parameters.
1202
1230
  */
1203
1231
  _list(options) {
1204
- return this.client.sendOperationRequest({ options }, listOperationSpec$1);
1232
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
1205
1233
  }
1206
1234
  /**
1207
1235
  * ListNext
@@ -1209,12 +1237,12 @@ class OperationsImpl {
1209
1237
  * @param options The options parameters.
1210
1238
  */
1211
1239
  _listNext(nextLink, options) {
1212
- return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$1);
1240
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
1213
1241
  }
1214
1242
  }
1215
1243
  // Operation Specifications
1216
- const serializer$1 = coreClient.createSerializer(Mappers, /* isXml */ false);
1217
- const listOperationSpec$1 = {
1244
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1245
+ const listOperationSpec = {
1218
1246
  path: "/providers/Microsoft.HealthBot/operations",
1219
1247
  httpMethod: "GET",
1220
1248
  responses: {
@@ -1228,9 +1256,9 @@ const listOperationSpec$1 = {
1228
1256
  queryParameters: [apiVersion],
1229
1257
  urlParameters: [$host],
1230
1258
  headerParameters: [accept],
1231
- serializer: serializer$1
1259
+ serializer
1232
1260
  };
1233
- const listNextOperationSpec$1 = {
1261
+ const listNextOperationSpec = {
1234
1262
  path: "{nextLink}",
1235
1263
  httpMethod: "GET",
1236
1264
  responses: {
@@ -1244,7 +1272,7 @@ const listNextOperationSpec$1 = {
1244
1272
  queryParameters: [apiVersion],
1245
1273
  urlParameters: [$host, nextLink],
1246
1274
  headerParameters: [accept],
1247
- serializer: serializer$1
1275
+ serializer
1248
1276
  };
1249
1277
 
1250
1278
  /*
@@ -1254,7 +1282,7 @@ const listNextOperationSpec$1 = {
1254
1282
  * Code generated by Microsoft (R) AutoRest Code Generator.
1255
1283
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1256
1284
  */
1257
- class HealthbotClient extends coreClient.ServiceClient {
1285
+ class HealthbotClient extends coreClient__namespace.ServiceClient {
1258
1286
  /**
1259
1287
  * Initializes a new instance of the HealthbotClient class.
1260
1288
  * @param credentials Subscription credentials which uniquely identify client subscription.
@@ -1262,6 +1290,7 @@ class HealthbotClient extends coreClient.ServiceClient {
1262
1290
  * @param options The parameter options
1263
1291
  */
1264
1292
  constructor(credentials, subscriptionId, options) {
1293
+ var _a, _b;
1265
1294
  if (credentials === undefined) {
1266
1295
  throw new Error("'credentials' cannot be null");
1267
1296
  }
@@ -1276,7 +1305,7 @@ class HealthbotClient extends coreClient.ServiceClient {
1276
1305
  requestContentType: "application/json; charset=utf-8",
1277
1306
  credential: credentials
1278
1307
  };
1279
- const packageDetails = `azsdk-js-arm-healthbot/2.0.0`;
1308
+ const packageDetails = `azsdk-js-arm-healthbot/2.0.1`;
1280
1309
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1281
1310
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1282
1311
  : `${packageDetails}`;
@@ -1285,8 +1314,24 @@ class HealthbotClient extends coreClient.ServiceClient {
1285
1314
  }
1286
1315
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1287
1316
  userAgentPrefix
1288
- }, baseUri: options.endpoint || "https://management.azure.com" });
1317
+ }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1289
1318
  super(optionsWithDefaults);
1319
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
1320
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
1321
+ const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
1322
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
1323
+ if (!bearerTokenAuthenticationPolicyFound) {
1324
+ this.pipeline.removePolicy({
1325
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
1326
+ });
1327
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
1328
+ scopes: `${optionsWithDefaults.baseUri}/.default`,
1329
+ challengeCallbacks: {
1330
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
1331
+ }
1332
+ }));
1333
+ }
1334
+ }
1290
1335
  // Parameter assignments
1291
1336
  this.subscriptionId = subscriptionId;
1292
1337
  // Assigning values to Constant parameters