@azure/ai-text-analytics 5.2.0-alpha.20211215.1 → 5.2.0-alpha.20220221.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 (63) hide show
  1. package/dist/index.js +130 -103
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/src/analyzeActionsResult.js +15 -15
  4. package/dist-esm/src/analyzeActionsResult.js.map +1 -1
  5. package/dist-esm/src/analyzeHealthcareEntitiesResult.js +4 -4
  6. package/dist-esm/src/analyzeHealthcareEntitiesResult.js.map +1 -1
  7. package/dist-esm/src/analyzeLro.js +11 -11
  8. package/dist-esm/src/analyzeLro.js.map +1 -1
  9. package/dist-esm/src/analyzeSentimentResult.js +5 -5
  10. package/dist-esm/src/analyzeSentimentResult.js.map +1 -1
  11. package/dist-esm/src/analyzeSentimentResultArray.js +1 -1
  12. package/dist-esm/src/analyzeSentimentResultArray.js.map +1 -1
  13. package/dist-esm/src/azureKeyCredentialPolicy.js +1 -1
  14. package/dist-esm/src/azureKeyCredentialPolicy.js.map +1 -1
  15. package/dist-esm/src/detectLanguageResult.js +1 -1
  16. package/dist-esm/src/detectLanguageResult.js.map +1 -1
  17. package/dist-esm/src/detectLanguageResultArray.js +1 -1
  18. package/dist-esm/src/detectLanguageResultArray.js.map +1 -1
  19. package/dist-esm/src/extractKeyPhrasesResult.js +1 -1
  20. package/dist-esm/src/extractKeyPhrasesResult.js.map +1 -1
  21. package/dist-esm/src/extractKeyPhrasesResultArray.js +1 -1
  22. package/dist-esm/src/extractKeyPhrasesResultArray.js.map +1 -1
  23. package/dist-esm/src/extractSummaryResult.js +1 -1
  24. package/dist-esm/src/extractSummaryResult.js.map +1 -1
  25. package/dist-esm/src/extractSummaryResultArray.js +1 -1
  26. package/dist-esm/src/extractSummaryResultArray.js.map +1 -1
  27. package/dist-esm/src/healthLro.js +12 -12
  28. package/dist-esm/src/healthLro.js.map +1 -1
  29. package/dist-esm/src/index.js +2 -4
  30. package/dist-esm/src/index.js.map +1 -1
  31. package/dist-esm/src/multiCategoryClassifyResult.js +1 -1
  32. package/dist-esm/src/multiCategoryClassifyResult.js.map +1 -1
  33. package/dist-esm/src/multiCategoryClassifyResultArray.js +1 -1
  34. package/dist-esm/src/multiCategoryClassifyResultArray.js.map +1 -1
  35. package/dist-esm/src/recognizeCategorizedEntitiesResult.js +1 -1
  36. package/dist-esm/src/recognizeCategorizedEntitiesResult.js.map +1 -1
  37. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js +1 -1
  38. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js.map +1 -1
  39. package/dist-esm/src/recognizeCustomEntitiesResult.js +1 -1
  40. package/dist-esm/src/recognizeCustomEntitiesResult.js.map +1 -1
  41. package/dist-esm/src/recognizeCustomEntitiesResultArray.js +1 -1
  42. package/dist-esm/src/recognizeCustomEntitiesResultArray.js.map +1 -1
  43. package/dist-esm/src/recognizeLinkedEntitiesResult.js +1 -1
  44. package/dist-esm/src/recognizeLinkedEntitiesResult.js.map +1 -1
  45. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js +1 -1
  46. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js.map +1 -1
  47. package/dist-esm/src/recognizePiiEntitiesResult.js +1 -1
  48. package/dist-esm/src/recognizePiiEntitiesResult.js.map +1 -1
  49. package/dist-esm/src/recognizePiiEntitiesResultArray.js +1 -1
  50. package/dist-esm/src/recognizePiiEntitiesResultArray.js.map +1 -1
  51. package/dist-esm/src/singleCategoryClassifyResult.js +1 -1
  52. package/dist-esm/src/singleCategoryClassifyResult.js.map +1 -1
  53. package/dist-esm/src/singleCategoryClassifyResultArray.js +1 -1
  54. package/dist-esm/src/singleCategoryClassifyResultArray.js.map +1 -1
  55. package/dist-esm/src/textAnalyticsClient.js +41 -41
  56. package/dist-esm/src/textAnalyticsClient.js.map +1 -1
  57. package/dist-esm/src/textAnalyticsResult.js +5 -5
  58. package/dist-esm/src/textAnalyticsResult.js.map +1 -1
  59. package/dist-esm/src/tracing.js +1 -1
  60. package/dist-esm/src/tracing.js.map +1 -1
  61. package/dist-esm/src/util.js +6 -6
  62. package/dist-esm/src/util.js.map +1 -1
  63. package/package.json +14 -20
package/dist/index.js CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('@azure/core-asynciterator-polyfill');
6
5
  var coreAuth = require('@azure/core-auth');
7
6
  var tslib = require('tslib');
8
7
  var coreRestPipeline = require('@azure/core-rest-pipeline');
@@ -12,6 +11,26 @@ var coreTracing = require('@azure/core-tracing');
12
11
  var corePaging = require('@azure/core-paging');
13
12
  var coreLro = require('@azure/core-lro');
14
13
 
14
+ function _interopNamespace(e) {
15
+ if (e && e.__esModule) return e;
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () { return e[k]; }
24
+ });
25
+ }
26
+ });
27
+ }
28
+ n["default"] = e;
29
+ return Object.freeze(n);
30
+ }
31
+
32
+ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
33
+
15
34
  /*
16
35
  * Copyright (c) Microsoft Corporation.
17
36
  * Licensed under the MIT License.
@@ -3600,7 +3619,7 @@ const opinionMining = {
3600
3619
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
3601
3620
  */
3602
3621
  /** @internal */
3603
- class GeneratedClientContext extends coreClient.ServiceClient {
3622
+ class GeneratedClientContext extends coreClient__namespace.ServiceClient {
3604
3623
  /**
3605
3624
  * Initializes a new instance of the GeneratedClientContext class.
3606
3625
  * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example:
@@ -3666,7 +3685,7 @@ class GeneratedClient extends GeneratedClientContext {
3666
3685
  * @param options The options parameters.
3667
3686
  */
3668
3687
  analyzeStatus(jobId, options) {
3669
- return this.sendOperationRequest({ jobId, options }, analyzeStatusOperationSpec);
3688
+ return this.sendOperationRequest({ jobId, options }, analyzeStatusOperationSpec$1);
3670
3689
  }
3671
3690
  /**
3672
3691
  * Get details of the healthcare prediction job specified by the jobId.
@@ -3674,7 +3693,7 @@ class GeneratedClient extends GeneratedClientContext {
3674
3693
  * @param options The options parameters.
3675
3694
  */
3676
3695
  healthStatus(jobId, options) {
3677
- return this.sendOperationRequest({ jobId, options }, healthStatusOperationSpec);
3696
+ return this.sendOperationRequest({ jobId, options }, healthStatusOperationSpec$1);
3678
3697
  }
3679
3698
  /**
3680
3699
  * Cancel healthcare prediction job.
@@ -3759,7 +3778,7 @@ class GeneratedClient extends GeneratedClientContext {
3759
3778
  }
3760
3779
  }
3761
3780
  // Operation Specifications
3762
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
3781
+ const serializer$2 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
3763
3782
  const analyzeOperationSpec = {
3764
3783
  path: "/analyze",
3765
3784
  httpMethod: "POST",
@@ -3775,9 +3794,9 @@ const analyzeOperationSpec = {
3775
3794
  urlParameters: [endpoint, apiVersion],
3776
3795
  headerParameters: [contentType, accept],
3777
3796
  mediaType: "json",
3778
- serializer
3797
+ serializer: serializer$2
3779
3798
  };
3780
- const analyzeStatusOperationSpec = {
3799
+ const analyzeStatusOperationSpec$1 = {
3781
3800
  path: "/analyze/jobs/{jobId}",
3782
3801
  httpMethod: "GET",
3783
3802
  responses: {
@@ -3795,9 +3814,9 @@ const analyzeStatusOperationSpec = {
3795
3814
  ],
3796
3815
  urlParameters: [endpoint, apiVersion, jobId],
3797
3816
  headerParameters: [accept],
3798
- serializer
3817
+ serializer: serializer$2
3799
3818
  };
3800
- const healthStatusOperationSpec = {
3819
+ const healthStatusOperationSpec$1 = {
3801
3820
  path: "/entities/health/jobs/{jobId}",
3802
3821
  httpMethod: "GET",
3803
3822
  responses: {
@@ -3819,7 +3838,7 @@ const healthStatusOperationSpec = {
3819
3838
  jobId1
3820
3839
  ],
3821
3840
  headerParameters: [accept],
3822
- serializer
3841
+ serializer: serializer$2
3823
3842
  };
3824
3843
  const cancelHealthJobOperationSpec = {
3825
3844
  path: "/entities/health/jobs/{jobId}",
@@ -3838,7 +3857,7 @@ const cancelHealthJobOperationSpec = {
3838
3857
  jobId1
3839
3858
  ],
3840
3859
  headerParameters: [accept],
3841
- serializer
3860
+ serializer: serializer$2
3842
3861
  };
3843
3862
  const healthOperationSpec = {
3844
3863
  path: "/entities/health/jobs",
@@ -3860,7 +3879,7 @@ const healthOperationSpec = {
3860
3879
  urlParameters: [endpoint, apiVersion],
3861
3880
  headerParameters: [contentType, accept],
3862
3881
  mediaType: "json",
3863
- serializer
3882
+ serializer: serializer$2
3864
3883
  };
3865
3884
  const entitiesRecognitionGeneralOperationSpec = {
3866
3885
  path: "/entities/recognition/general",
@@ -3883,7 +3902,7 @@ const entitiesRecognitionGeneralOperationSpec = {
3883
3902
  urlParameters: [endpoint, apiVersion],
3884
3903
  headerParameters: [contentType, accept],
3885
3904
  mediaType: "json",
3886
- serializer
3905
+ serializer: serializer$2
3887
3906
  };
3888
3907
  const entitiesRecognitionPiiOperationSpec = {
3889
3908
  path: "/entities/recognition/pii",
@@ -3908,7 +3927,7 @@ const entitiesRecognitionPiiOperationSpec = {
3908
3927
  urlParameters: [endpoint, apiVersion],
3909
3928
  headerParameters: [contentType, accept],
3910
3929
  mediaType: "json",
3911
- serializer
3930
+ serializer: serializer$2
3912
3931
  };
3913
3932
  const entitiesLinkingOperationSpec = {
3914
3933
  path: "/entities/linking",
@@ -3931,7 +3950,7 @@ const entitiesLinkingOperationSpec = {
3931
3950
  urlParameters: [endpoint, apiVersion],
3932
3951
  headerParameters: [contentType, accept],
3933
3952
  mediaType: "json",
3934
- serializer
3953
+ serializer: serializer$2
3935
3954
  };
3936
3955
  const keyPhrasesOperationSpec = {
3937
3956
  path: "/keyPhrases",
@@ -3953,7 +3972,7 @@ const keyPhrasesOperationSpec = {
3953
3972
  urlParameters: [endpoint, apiVersion],
3954
3973
  headerParameters: [contentType, accept],
3955
3974
  mediaType: "json",
3956
- serializer
3975
+ serializer: serializer$2
3957
3976
  };
3958
3977
  const languagesOperationSpec = {
3959
3978
  path: "/languages",
@@ -3975,7 +3994,7 @@ const languagesOperationSpec = {
3975
3994
  urlParameters: [endpoint, apiVersion],
3976
3995
  headerParameters: [contentType, accept],
3977
3996
  mediaType: "json",
3978
- serializer
3997
+ serializer: serializer$2
3979
3998
  };
3980
3999
  const sentimentOperationSpec = {
3981
4000
  path: "/sentiment",
@@ -3999,7 +4018,7 @@ const sentimentOperationSpec = {
3999
4018
  urlParameters: [endpoint, apiVersion],
4000
4019
  headerParameters: [contentType, accept],
4001
4020
  mediaType: "json",
4002
- serializer
4021
+ serializer: serializer$2
4003
4022
  };
4004
4023
 
4005
4024
  // Copyright (c) Microsoft Corporation.
@@ -4016,7 +4035,7 @@ const logger = logger$1.createClientLogger("ai-text-analytics");
4016
4035
  */
4017
4036
  const createSpan = coreTracing.createSpanFunction({
4018
4037
  packagePrefix: "Azure.CognitiveServices.TextAnalytics",
4019
- namespace: "Microsoft.CognitiveServices"
4038
+ namespace: "Microsoft.CognitiveServices",
4020
4039
  });
4021
4040
 
4022
4041
  // Copyright (c) Microsoft Corporation.
@@ -4056,7 +4075,7 @@ function parseAssessmentIndex(pointer) {
4056
4075
  const assessmentIndex = {
4057
4076
  document: parseInt(res[1]),
4058
4077
  sentence: parseInt(res[2]),
4059
- assessment: parseInt(res[3])
4078
+ assessment: parseInt(res[3]),
4060
4079
  };
4061
4080
  return assessmentIndex;
4062
4081
  }
@@ -4161,7 +4180,7 @@ function compileError(errorResponse) {
4161
4180
  unwrap(topLevelError);
4162
4181
  return new coreRestPipeline.RestError(errorMessage, {
4163
4182
  code: invalidDocumentBatchCode ? "InvalidDocumentBatch" : topLevelError.code,
4164
- statusCode: castErrorResponse.statusCode
4183
+ statusCode: castErrorResponse.statusCode,
4165
4184
  });
4166
4185
  }
4167
4186
  /**
@@ -4185,8 +4204,8 @@ async function getRawResponse(f, options) {
4185
4204
  rawResponse: {
4186
4205
  statusCode: rawResponse.status,
4187
4206
  headers: rawResponse.headers.toJSON(),
4188
- body: rawResponse.parsedBody
4189
- }
4207
+ body: rawResponse.parsedBody,
4208
+ },
4190
4209
  };
4191
4210
  }
4192
4211
  /**
@@ -4200,13 +4219,13 @@ client, spec, spanStr, options, path) {
4200
4219
  const { flatResponse, rawResponse } = await getRawResponse((paramOptions) => client.sendOperationRequest({ options: paramOptions }, Object.assign(Object.assign({}, spec), { path, httpMethod: "GET" })), finalOptions);
4201
4220
  return {
4202
4221
  flatResponse: flatResponse,
4203
- rawResponse
4222
+ rawResponse,
4204
4223
  };
4205
4224
  }
4206
4225
  catch (e) {
4207
4226
  span.setStatus({
4208
4227
  code: coreTracing.SpanStatusCode.ERROR,
4209
- message: e.message
4228
+ message: e.message,
4210
4229
  });
4211
4230
  throw e;
4212
4231
  }
@@ -4230,7 +4249,7 @@ function intoTextAnalyticsError(errorModel) {
4230
4249
  return {
4231
4250
  code: errorModel.code,
4232
4251
  message: errorModel.message,
4233
- target: errorModel.target
4252
+ target: errorModel.target,
4234
4253
  };
4235
4254
  }
4236
4255
  /**
@@ -4240,7 +4259,7 @@ function makeTextAnalyticsSuccessResult(id, warnings, statistics) {
4240
4259
  return {
4241
4260
  id,
4242
4261
  statistics,
4243
- warnings
4262
+ warnings,
4244
4263
  };
4245
4264
  }
4246
4265
  /**
@@ -4249,7 +4268,7 @@ function makeTextAnalyticsSuccessResult(id, warnings, statistics) {
4249
4268
  function makeTextAnalyticsErrorResult(id, error) {
4250
4269
  return {
4251
4270
  id,
4252
- error: intoTextAnalyticsError(error)
4271
+ error: intoTextAnalyticsError(error),
4253
4272
  };
4254
4273
  }
4255
4274
  /**
@@ -4277,7 +4296,7 @@ function combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(inp
4277
4296
  const sorted = processAndCombineSuccessfulAndErroneousDocuments(input, response, processSuccess, processError);
4278
4297
  return Object.assign(sorted, {
4279
4298
  statistics: response.statistics,
4280
- modelVersion: response.modelVersion
4299
+ modelVersion: response.modelVersion,
4281
4300
  });
4282
4301
  }
4283
4302
  /**
@@ -4293,7 +4312,7 @@ function combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInf
4293
4312
  return Object.assign(sorted, {
4294
4313
  statistics: response.statistics,
4295
4314
  projectName: response.projectName,
4296
- deploymentName: response.deploymentName
4315
+ deploymentName: response.deploymentName,
4297
4316
  });
4298
4317
  }
4299
4318
 
@@ -4349,7 +4368,7 @@ function makeRecognizeCategorizedEntitiesResultArray(input, response) {
4349
4368
  * @internal
4350
4369
  */
4351
4370
  function makeAnalyzeSentimentResult(result) {
4352
- const { id, sentiment, confidenceScores, sentenceSentiments: sentences, warnings, statistics } = result;
4371
+ const { id, sentiment, confidenceScores, sentenceSentiments: sentences, warnings, statistics, } = result;
4353
4372
  return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { sentiment,
4354
4373
  confidenceScores, sentences: sentences.map((sentence) => convertGeneratedSentenceSentiment(sentence, result)) });
4355
4374
  }
@@ -4382,13 +4401,13 @@ function convertGeneratedSentenceSentiment(sentence, result) {
4382
4401
  sentiment: target.sentiment,
4383
4402
  text: target.text,
4384
4403
  offset: target.offset,
4385
- length: target.length
4404
+ length: target.length,
4386
4405
  },
4387
4406
  assessments: target.relations
4388
4407
  .filter((relation) => relation.relationType === "assessment")
4389
- .map((relation) => convertTargetRelationToAssessmentSentiment(relation, result))
4408
+ .map((relation) => convertTargetRelationToAssessmentSentiment(relation, result)),
4390
4409
  }))
4391
- : []
4410
+ : [],
4392
4411
  };
4393
4412
  }
4394
4413
  /**
@@ -4510,7 +4529,7 @@ function textAnalyticsAzureKeyCredentialPolicy(credential) {
4510
4529
  sendRequest(request, next) {
4511
4530
  request.headers.set(API_KEY_HEADER_NAME, credential.key);
4512
4531
  return next(request);
4513
- }
4532
+ },
4514
4533
  };
4515
4534
  }
4516
4535
 
@@ -4532,7 +4551,7 @@ function makeHealthcareEntitiesWithoutNeighbors(entity) {
4532
4551
  text,
4533
4552
  normalizedText: name,
4534
4553
  subCategory: subcategory,
4535
- dataSources: (_a = links === null || links === void 0 ? void 0 : links.map(({ dataSource, id }) => ({ name: dataSource, entityId: id }))) !== null && _a !== void 0 ? _a : []
4554
+ dataSources: (_a = links === null || links === void 0 ? void 0 : links.map(({ dataSource, id }) => ({ name: dataSource, entityId: id }))) !== null && _a !== void 0 ? _a : [],
4536
4555
  };
4537
4556
  }
4538
4557
  /**
@@ -4543,8 +4562,8 @@ function makeHealthcareRelations(entities, relations) {
4543
4562
  relationType: relation.relationType,
4544
4563
  roles: relation.entities.map((role) => ({
4545
4564
  entity: entities[parseHealthcareEntityIndex(role.ref)],
4546
- name: role.role
4547
- }))
4565
+ name: role.role,
4566
+ })),
4548
4567
  }));
4549
4568
  }
4550
4569
  /**
@@ -4567,21 +4586,21 @@ function makeHealthcareEntitiesErrorResult(id, error) {
4567
4586
  // Copyright (c) Microsoft Corporation.
4568
4587
  const serializer$1 = coreClient.createSerializer(Mappers, /* isXml */ false);
4569
4588
  // Consider whether the spec can be exported by code gen
4570
- const healthStatusOperationSpec$1 = {
4589
+ const healthStatusOperationSpec = {
4571
4590
  path: "/entities/health/jobs/{jobId}",
4572
4591
  httpMethod: "GET",
4573
4592
  responses: {
4574
4593
  200: {
4575
- bodyMapper: HealthcareJobState
4594
+ bodyMapper: HealthcareJobState,
4576
4595
  },
4577
4596
  default: {
4578
- bodyMapper: ErrorResponse
4579
- }
4597
+ bodyMapper: ErrorResponse,
4598
+ },
4580
4599
  },
4581
4600
  queryParameters: [includeStatistics, top, skip],
4582
4601
  urlParameters: [endpoint, apiVersion],
4583
4602
  headerParameters: [accept],
4584
- serializer: serializer$1
4603
+ serializer: serializer$1,
4585
4604
  };
4586
4605
  /**
4587
4606
  * @internal
@@ -4604,14 +4623,14 @@ class HealthLro {
4604
4623
  const { flatResponse, rawResponse } = await getRawResponse((paramOptions) => this.client.health({ documents: this.documents }, paramOptions), finalOptions);
4605
4624
  return {
4606
4625
  flatResponse: flatResponse,
4607
- rawResponse
4626
+ rawResponse,
4608
4627
  };
4609
4628
  }
4610
4629
  catch (e) {
4611
4630
  const exception = compileError(e);
4612
4631
  span.setStatus({
4613
4632
  code: coreTracing.SpanStatusCode.ERROR,
4614
- message: exception.message
4633
+ message: exception.message,
4615
4634
  });
4616
4635
  throw exception;
4617
4636
  }
@@ -4620,7 +4639,7 @@ class HealthLro {
4620
4639
  }
4621
4640
  }
4622
4641
  async sendPollRequest(path) {
4623
- return sendGetRequest(this.client, healthStatusOperationSpec$1, "HealthStatus", Object.assign(Object.assign({}, this.baseOptions), this.pollOptions), path);
4642
+ return sendGetRequest(this.client, healthStatusOperationSpec, "HealthStatus", Object.assign(Object.assign({}, this.baseOptions), this.pollOptions), path);
4624
4643
  }
4625
4644
  }
4626
4645
  /**
@@ -4659,7 +4678,7 @@ client, documents, options) {
4659
4678
  const pagedResult = {
4660
4679
  firstPageLink: pollingURL,
4661
4680
  getPage: async (pageLink, maxPageSize) => {
4662
- const response = await sendGetRequest(client, healthStatusOperationSpec$1, "HealthStatus",
4681
+ const response = await sendGetRequest(client, healthStatusOperationSpec, "HealthStatus",
4663
4682
  // if `top` is set to `undefined`, the default value will not be sent
4664
4683
  // as part of the request.
4665
4684
  maxPageSize ? Object.assign(Object.assign({}, options), { top: maxPageSize }) : options, pageLink);
@@ -4667,18 +4686,18 @@ client, documents, options) {
4667
4686
  if (flatResponse.results) {
4668
4687
  return {
4669
4688
  page: processAndCombineSuccessfulAndErroneousDocuments(documents, flatResponse.results, makeHealthcareEntitiesResult, makeHealthcareEntitiesErrorResult),
4670
- nextPageLink: flatResponse.nextLink
4689
+ nextPageLink: flatResponse.nextLink,
4671
4690
  };
4672
4691
  }
4673
4692
  else {
4674
4693
  throw new Error("Healthcare action has succeeded but there are no results!");
4675
4694
  }
4676
- }
4695
+ },
4677
4696
  };
4678
4697
  const pagedIterator = corePaging.getPagedAsyncIterator(pagedResult);
4679
4698
  return Object.assign(pagedIterator, {
4680
4699
  statistics: result.results.statistics,
4681
- modelVersion: result.results.modelVersion
4700
+ modelVersion: result.results.modelVersion,
4682
4701
  });
4683
4702
  };
4684
4703
  }
@@ -4841,7 +4860,7 @@ function parseActionError(erredActions) {
4841
4860
  code: erredActions.code,
4842
4861
  message: erredActions.message,
4843
4862
  index: parseInt(result[2]),
4844
- type: convertTaskTypeToActionType(result[1])
4863
+ type: convertTaskTypeToActionType(result[1]),
4845
4864
  };
4846
4865
  }
4847
4866
  else {
@@ -4912,7 +4931,7 @@ function createErredAction(error, lastUpdateDateTime, taskName) {
4912
4931
  return {
4913
4932
  error: intoTextAnalyticsError(error),
4914
4933
  failedOn: lastUpdateDateTime,
4915
- actionName: taskName
4934
+ actionName: taskName,
4916
4935
  };
4917
4936
  }
4918
4937
  /**
@@ -4934,14 +4953,14 @@ function makeActionResult(documents, makeResultsArray, succeededTasks, erredActi
4934
4953
  {
4935
4954
  results: recognizeEntitiesResults,
4936
4955
  completedOn: lastUpdateDateTime,
4937
- actionName: taskName
4938
- }
4956
+ actionName: taskName,
4957
+ },
4939
4958
  ];
4940
4959
  }
4941
4960
  else {
4942
4961
  return [
4943
4962
  ...actions,
4944
- createErredAction(erredActions[errorIndex++], lastUpdateDateTime, taskName)
4963
+ createErredAction(erredActions[errorIndex++], lastUpdateDateTime, taskName),
4945
4964
  ];
4946
4965
  }
4947
4966
  }
@@ -4975,27 +4994,27 @@ function createAnalyzeActionsResult(response, documents) {
4975
4994
  extractSummaryResults: makeActionResult(documents, makeExtractSummaryResultArray, (_g = response.tasks.extractiveSummarizationTasks) !== null && _g !== void 0 ? _g : [], extractSummarySentencesActionErrors),
4976
4995
  recognizeCustomEntitiesResults: makeActionResult(documents, makeRecognizeCustomEntitiesResultArray, (_h = response.tasks.customEntityRecognitionTasks) !== null && _h !== void 0 ? _h : [], recognizeCustomEntitiesActionErrors),
4977
4996
  singleCategoryClassifyResults: makeActionResult(documents, makeSingleCategoryClassifyResultArray, (_j = response.tasks.customSingleClassificationTasks) !== null && _j !== void 0 ? _j : [], singleCategoryClassifyActionErrors),
4978
- multiCategoryClassifyResults: makeActionResult(documents, makeMultiCategoryClassifyResultArray, (_k = response.tasks.customMultiClassificationTasks) !== null && _k !== void 0 ? _k : [], multiCategoryClassifyActionErrors)
4997
+ multiCategoryClassifyResults: makeActionResult(documents, makeMultiCategoryClassifyResultArray, (_k = response.tasks.customMultiClassificationTasks) !== null && _k !== void 0 ? _k : [], multiCategoryClassifyActionErrors),
4979
4998
  };
4980
4999
  }
4981
5000
 
4982
5001
  // Copyright (c) Microsoft Corporation.
4983
- const serializer$2 = coreClient.createSerializer(Mappers, /* isXml */ false);
5002
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
4984
5003
  // Consider whether the spec can be exported by code gen
4985
- const analyzeStatusOperationSpec$1 = {
5004
+ const analyzeStatusOperationSpec = {
4986
5005
  httpMethod: "GET",
4987
5006
  responses: {
4988
5007
  200: {
4989
- bodyMapper: AnalyzeJobState
5008
+ bodyMapper: AnalyzeJobState,
4990
5009
  },
4991
5010
  default: {
4992
- bodyMapper: ErrorResponse
4993
- }
5011
+ bodyMapper: ErrorResponse,
5012
+ },
4994
5013
  },
4995
5014
  queryParameters: [includeStatistics, top, skip],
4996
5015
  urlParameters: [endpoint, apiVersion],
4997
5016
  headerParameters: [accept],
4998
- serializer: serializer$2
5017
+ serializer,
4999
5018
  };
5000
5019
  /**
5001
5020
  * @internal
@@ -5019,18 +5038,18 @@ class AnalyzeLro {
5019
5038
  const { flatResponse, rawResponse } = await getRawResponse((paramOptions) => this.client.analyze(Object.assign({ body: {
5020
5039
  analysisInput: { documents: this.documents },
5021
5040
  tasks: this.tasks,
5022
- displayName: this.initOptions.displayName
5041
+ displayName: this.initOptions.displayName,
5023
5042
  } }, paramOptions)), finalOptions);
5024
5043
  return {
5025
5044
  flatResponse: flatResponse,
5026
- rawResponse
5045
+ rawResponse,
5027
5046
  };
5028
5047
  }
5029
5048
  catch (e) {
5030
5049
  const exception = compileError(e);
5031
5050
  span.setStatus({
5032
5051
  code: coreTracing.SpanStatusCode.ERROR,
5033
- message: exception.message
5052
+ message: exception.message,
5034
5053
  });
5035
5054
  throw exception;
5036
5055
  }
@@ -5039,7 +5058,7 @@ class AnalyzeLro {
5039
5058
  }
5040
5059
  }
5041
5060
  async sendPollRequest(path) {
5042
- return sendGetRequest(this.client, analyzeStatusOperationSpec$1, "AnalyzeStatus", Object.assign(Object.assign({}, this.baseOptions), this.pollOptions), path);
5061
+ return sendGetRequest(this.client, analyzeStatusOperationSpec, "AnalyzeStatus", Object.assign(Object.assign({}, this.baseOptions), this.pollOptions), path);
5043
5062
  }
5044
5063
  }
5045
5064
  /**
@@ -5067,16 +5086,16 @@ client, documents, options) {
5067
5086
  const pagedResult = {
5068
5087
  firstPageLink: pollingURL,
5069
5088
  getPage: async (pageLink, maxPageSize) => {
5070
- const response = await sendGetRequest(client, analyzeStatusOperationSpec$1, "AnalyzeStatus",
5089
+ const response = await sendGetRequest(client, analyzeStatusOperationSpec, "AnalyzeStatus",
5071
5090
  // if `top` is set to `undefined`, the default value will not be sent
5072
5091
  // as part of the request.
5073
5092
  maxPageSize ? Object.assign(Object.assign({}, options), { top: maxPageSize }) : options, pageLink);
5074
5093
  const flatResponse = response.flatResponse;
5075
5094
  return {
5076
5095
  page: createAnalyzeActionsResult(flatResponse, documents),
5077
- nextPageLink: flatResponse.nextLink
5096
+ nextPageLink: flatResponse.nextLink,
5078
5097
  };
5079
- }
5098
+ },
5080
5099
  };
5081
5100
  const pagedIterator = corePaging.getPagedAsyncIterator(pagedResult);
5082
5101
  // Attach stats if the service starts to return them
@@ -5104,6 +5123,10 @@ function updateAnalyzeState(state, lastResponse) {
5104
5123
 
5105
5124
  // Copyright (c) Microsoft Corporation.
5106
5125
  const DEFAULT_COGNITIVE_SCOPE = "https://cognitiveservices.azure.com/.default";
5126
+ /**
5127
+ * The types of PII domains the user can choose from.
5128
+ */
5129
+ exports.PiiEntityDomain = void 0;
5107
5130
  (function (PiiEntityDomain) {
5108
5131
  /**
5109
5132
  * @see {@link https://aka.ms/tanerpii} for more information.
@@ -5138,8 +5161,8 @@ class TextAnalyticsClient {
5138
5161
  const internalPipelineOptions = Object.assign(Object.assign({}, pipelineOptions), {
5139
5162
  loggingOptions: {
5140
5163
  logger: logger.info,
5141
- additionalAllowedHeaderNames: ["x-ms-correlation-request-id", "x-ms-request-id"]
5142
- }
5164
+ additionalAllowedHeaderNames: ["x-ms-correlation-request-id", "x-ms-request-id"],
5165
+ },
5143
5166
  });
5144
5167
  this.client = new GeneratedClient(this.endpointUrl, internalPipelineOptions);
5145
5168
  const authPolicy = coreAuth.isTokenCredential(credential)
@@ -5166,14 +5189,14 @@ class TextAnalyticsClient {
5166
5189
  const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-detectLanguages", makeGeneratedDetectLanguageOptions(realOptions));
5167
5190
  try {
5168
5191
  const result = await this.client.languages({
5169
- documents: realInputs
5192
+ documents: realInputs,
5170
5193
  }, finalOptions);
5171
5194
  return makeDetectLanguageResultArray(realInputs, result);
5172
5195
  }
5173
5196
  catch (e) {
5174
5197
  span.setStatus({
5175
5198
  code: coreTracing.SpanStatusCode.ERROR,
5176
- message: e.message
5199
+ message: e.message,
5177
5200
  });
5178
5201
  throw e;
5179
5202
  }
@@ -5201,7 +5224,7 @@ class TextAnalyticsClient {
5201
5224
  const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizeEntities", makeGeneratedRecognizeCategorizedEntitiesOptions(realOptions));
5202
5225
  try {
5203
5226
  const result = await this.client.entitiesRecognitionGeneral({
5204
- documents: realInputs
5227
+ documents: realInputs,
5205
5228
  }, finalOptions);
5206
5229
  return makeRecognizeCategorizedEntitiesResultArray(realInputs, result);
5207
5230
  }
@@ -5217,7 +5240,7 @@ class TextAnalyticsClient {
5217
5240
  const backwardCompatibleException = compileError(e);
5218
5241
  span.setStatus({
5219
5242
  code: coreTracing.SpanStatusCode.ERROR,
5220
- message: backwardCompatibleException.message
5243
+ message: backwardCompatibleException.message,
5221
5244
  });
5222
5245
  throw backwardCompatibleException;
5223
5246
  }
@@ -5243,14 +5266,14 @@ class TextAnalyticsClient {
5243
5266
  const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-analyzeSentiment", makeGeneratedAnalyzeSentimentOptions(realOptions));
5244
5267
  try {
5245
5268
  const result = await this.client.sentiment({
5246
- documents: realInputs
5269
+ documents: realInputs,
5247
5270
  }, finalOptions);
5248
5271
  return makeAnalyzeSentimentResultArray(realInputs, result);
5249
5272
  }
5250
5273
  catch (e) {
5251
5274
  span.setStatus({
5252
5275
  code: coreTracing.SpanStatusCode.ERROR,
5253
- message: e.message
5276
+ message: e.message,
5254
5277
  });
5255
5278
  throw e;
5256
5279
  }
@@ -5276,14 +5299,14 @@ class TextAnalyticsClient {
5276
5299
  const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-extractKeyPhrases", makeGeneratedExtractKeyPhrasesOptions(realOptions));
5277
5300
  try {
5278
5301
  const result = await this.client.keyPhrases({
5279
- documents: realInputs
5302
+ documents: realInputs,
5280
5303
  }, finalOptions);
5281
5304
  return makeExtractKeyPhrasesResultArray(realInputs, result);
5282
5305
  }
5283
5306
  catch (e) {
5284
5307
  span.setStatus({
5285
5308
  code: coreTracing.SpanStatusCode.ERROR,
5286
- message: e.message
5309
+ message: e.message,
5287
5310
  });
5288
5311
  throw e;
5289
5312
  }
@@ -5306,14 +5329,14 @@ class TextAnalyticsClient {
5306
5329
  const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizePiiEntities", makeGeneratedRecognizePiiEntitiesOptions(realOptions));
5307
5330
  try {
5308
5331
  const result = await this.client.entitiesRecognitionPii({
5309
- documents: realInputs
5332
+ documents: realInputs,
5310
5333
  }, finalOptions);
5311
5334
  return makeRecognizePiiEntitiesResultArray(realInputs, result);
5312
5335
  }
5313
5336
  catch (e) {
5314
5337
  span.setStatus({
5315
5338
  code: coreTracing.SpanStatusCode.ERROR,
5316
- message: e.message
5339
+ message: e.message,
5317
5340
  });
5318
5341
  throw e;
5319
5342
  }
@@ -5339,14 +5362,14 @@ class TextAnalyticsClient {
5339
5362
  const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizeLinkedEntities", makeGeneratedRecognizeLinkingEntitiesOptions(realOptions));
5340
5363
  try {
5341
5364
  const result = await this.client.entitiesLinking({
5342
- documents: realInputs
5365
+ documents: realInputs,
5343
5366
  }, finalOptions);
5344
5367
  return makeRecognizeLinkedEntitiesResultArray(realInputs, result);
5345
5368
  }
5346
5369
  catch (e) {
5347
5370
  span.setStatus({
5348
5371
  code: coreTracing.SpanStatusCode.ERROR,
5349
- message: e.message
5372
+ message: e.message,
5350
5373
  });
5351
5374
  throw e;
5352
5375
  }
@@ -5366,13 +5389,13 @@ class TextAnalyticsClient {
5366
5389
  realInputs = documents;
5367
5390
  realOptions = languageOrOptions || {};
5368
5391
  }
5369
- const { updateIntervalInMs, resumeFrom, onResponse, disableServiceLogs, modelVersion, requestOptions, serializerOptions, abortSignal, stringIndexType, includeStatistics, tracingOptions } = realOptions;
5392
+ const { updateIntervalInMs, resumeFrom, onResponse, disableServiceLogs, modelVersion, requestOptions, serializerOptions, abortSignal, stringIndexType, includeStatistics, tracingOptions, } = realOptions;
5370
5393
  const lro = new HealthLro(this.client, {
5371
5394
  onResponse,
5372
5395
  requestOptions,
5373
5396
  serializerOptions,
5374
5397
  abortSignal,
5375
- tracingOptions
5398
+ tracingOptions,
5376
5399
  }, { loggingOptOut: disableServiceLogs, stringIndexType, modelVersion }, { includeStatistics }, realInputs);
5377
5400
  const poller = new coreLro.LroEngine(lro, {
5378
5401
  intervalInMs: updateIntervalInMs,
@@ -5383,10 +5406,10 @@ class TextAnalyticsClient {
5383
5406
  serializerOptions,
5384
5407
  abortSignal,
5385
5408
  tracingOptions,
5386
- includeStatistics
5409
+ includeStatistics,
5387
5410
  }),
5388
5411
  isDone: isHealthDone,
5389
- updateState: updateHealthState
5412
+ updateState: updateHealthState,
5390
5413
  });
5391
5414
  await poller.poll();
5392
5415
  return poller;
@@ -5407,13 +5430,13 @@ class TextAnalyticsClient {
5407
5430
  realOptions = languageOrOptions || {};
5408
5431
  }
5409
5432
  const compiledActions = compileAnalyzeInput(actions);
5410
- const { updateIntervalInMs, resumeFrom, displayName, includeStatistics, onResponse, requestOptions, serializerOptions, abortSignal, tracingOptions } = realOptions;
5433
+ const { updateIntervalInMs, resumeFrom, displayName, includeStatistics, onResponse, requestOptions, serializerOptions, abortSignal, tracingOptions, } = realOptions;
5411
5434
  const lro = new AnalyzeLro(this.client, {
5412
5435
  onResponse,
5413
5436
  requestOptions,
5414
5437
  serializerOptions,
5415
5438
  abortSignal,
5416
- tracingOptions
5439
+ tracingOptions,
5417
5440
  }, { displayName }, { includeStatistics }, realInputs, compiledActions);
5418
5441
  const poller = new coreLro.LroEngine(lro, {
5419
5442
  intervalInMs: updateIntervalInMs,
@@ -5424,10 +5447,10 @@ class TextAnalyticsClient {
5424
5447
  serializerOptions,
5425
5448
  abortSignal,
5426
5449
  tracingOptions,
5427
- includeStatistics
5450
+ includeStatistics,
5428
5451
  }),
5429
5452
  isDone: isAnalyzeDone,
5430
- updateState: updateAnalyzeState
5453
+ updateState: updateAnalyzeState,
5431
5454
  });
5432
5455
  await poller.poll();
5433
5456
  return poller;
@@ -5447,7 +5470,7 @@ function compileAnalyzeInput(actions) {
5447
5470
  extractiveSummarizationTasks: (_f = actions.extractSummaryActions) === null || _f === void 0 ? void 0 : _f.map(compose(setStrEncodingParam, compose(setSentenceCount, compose(setOrderBy, addParamsToTask)))),
5448
5471
  customEntityRecognitionTasks: (_g = actions.recognizeCustomEntitiesActions) === null || _g === void 0 ? void 0 : _g.map(compose(setStrEncodingParam, addParamsToTask)),
5449
5472
  customSingleClassificationTasks: (_h = actions.singleCategoryClassifyActions) === null || _h === void 0 ? void 0 : _h.map(addParamsToTask),
5450
- customMultiClassificationTasks: (_j = actions.multiCategoryClassifyActions) === null || _j === void 0 ? void 0 : _j.map(addParamsToTask)
5473
+ customMultiClassificationTasks: (_j = actions.multiCategoryClassifyActions) === null || _j === void 0 ? void 0 : _j.map(addParamsToTask),
5451
5474
  };
5452
5475
  }
5453
5476
  function isStringArray(documents) {
@@ -5464,7 +5487,7 @@ function convertToDetectLanguageInput(inputs, countryHint) {
5464
5487
  return {
5465
5488
  id: String(index),
5466
5489
  countryHint,
5467
- text
5490
+ text,
5468
5491
  };
5469
5492
  });
5470
5493
  }
@@ -5476,7 +5499,7 @@ function convertToTextDocumentInput(inputs, language) {
5476
5499
  return {
5477
5500
  id: String(index),
5478
5501
  language,
5479
- text
5502
+ text,
5480
5503
  };
5481
5504
  });
5482
5505
  }
@@ -5496,7 +5519,7 @@ function makeGeneratedAnalyzeSentimentOptions(params) {
5496
5519
  tracingOptions: params.tracingOptions,
5497
5520
  onResponse: params.onResponse,
5498
5521
  serializerOptions: params.serializerOptions,
5499
- loggingOptOut: params.disableServiceLogs
5522
+ loggingOptOut: params.disableServiceLogs,
5500
5523
  };
5501
5524
  }
5502
5525
  /**
@@ -5516,7 +5539,7 @@ function makeGeneratedRecognizePiiEntitiesOptions(params) {
5516
5539
  piiCategories: params.categoriesFilter,
5517
5540
  onResponse: params.onResponse,
5518
5541
  serializerOptions: params.serializerOptions,
5519
- loggingOptOut: params.disableServiceLogs
5542
+ loggingOptOut: params.disableServiceLogs,
5520
5543
  };
5521
5544
  }
5522
5545
  /**
@@ -5534,7 +5557,7 @@ function makeGeneratedRecognizeCategorizedEntitiesOptions(params) {
5534
5557
  tracingOptions: params.tracingOptions,
5535
5558
  onResponse: params.onResponse,
5536
5559
  serializerOptions: params.serializerOptions,
5537
- loggingOptOut: params.disableServiceLogs
5560
+ loggingOptOut: params.disableServiceLogs,
5538
5561
  };
5539
5562
  }
5540
5563
  /**
@@ -5551,7 +5574,7 @@ function makeGeneratedDetectLanguageOptions(params) {
5551
5574
  tracingOptions: params.tracingOptions,
5552
5575
  onResponse: params.onResponse,
5553
5576
  serializerOptions: params.serializerOptions,
5554
- loggingOptOut: params.disableServiceLogs
5577
+ loggingOptOut: params.disableServiceLogs,
5555
5578
  };
5556
5579
  }
5557
5580
  /**
@@ -5568,7 +5591,7 @@ function makeGeneratedExtractKeyPhrasesOptions(params) {
5568
5591
  tracingOptions: params.tracingOptions,
5569
5592
  onResponse: params.onResponse,
5570
5593
  serializerOptions: params.serializerOptions,
5571
- loggingOptOut: params.disableServiceLogs
5594
+ loggingOptOut: params.disableServiceLogs,
5572
5595
  };
5573
5596
  }
5574
5597
  /**
@@ -5586,7 +5609,7 @@ function makeGeneratedRecognizeLinkingEntitiesOptions(params) {
5586
5609
  onResponse: params.onResponse,
5587
5610
  serializerOptions: params.serializerOptions,
5588
5611
  loggingOptOut: params.disableServiceLogs,
5589
- stringIndexType: setStrEncodingParamValue(params.stringIndexType)
5612
+ stringIndexType: setStrEncodingParamValue(params.stringIndexType),
5590
5613
  };
5591
5614
  }
5592
5615
 
@@ -5805,6 +5828,8 @@ var KnownErrorCodeValue;
5805
5828
  KnownErrorCodeValue["ServiceUnavailable"] = "ServiceUnavailable";
5806
5829
  KnownErrorCodeValue["NotFound"] = "NotFound";
5807
5830
  })(KnownErrorCodeValue || (KnownErrorCodeValue = {}));
5831
+ /** Known values of {@link InnerErrorCodeValue} that the service accepts. */
5832
+ exports.KnownInnerErrorCodeValue = void 0;
5808
5833
  (function (KnownInnerErrorCodeValue) {
5809
5834
  KnownInnerErrorCodeValue["InvalidParameterValue"] = "InvalidParameterValue";
5810
5835
  KnownInnerErrorCodeValue["InvalidRequestBodyFormat"] = "InvalidRequestBodyFormat";
@@ -5816,10 +5841,14 @@ var KnownErrorCodeValue;
5816
5841
  KnownInnerErrorCodeValue["UnsupportedLanguageCode"] = "UnsupportedLanguageCode";
5817
5842
  KnownInnerErrorCodeValue["InvalidCountryHint"] = "InvalidCountryHint";
5818
5843
  })(exports.KnownInnerErrorCodeValue || (exports.KnownInnerErrorCodeValue = {}));
5844
+ /** Known values of {@link WarningCode} that the service accepts. */
5845
+ exports.KnownWarningCode = void 0;
5819
5846
  (function (KnownWarningCode) {
5820
5847
  KnownWarningCode["LongWordsInDocument"] = "LongWordsInDocument";
5821
5848
  KnownWarningCode["DocumentTruncated"] = "DocumentTruncated";
5822
5849
  })(exports.KnownWarningCode || (exports.KnownWarningCode = {}));
5850
+ /** Known values of {@link HealthcareEntityCategory} that the service accepts. */
5851
+ exports.KnownHealthcareEntityCategory = void 0;
5823
5852
  (function (KnownHealthcareEntityCategory) {
5824
5853
  KnownHealthcareEntityCategory["BodyStructure"] = "BODY_STRUCTURE";
5825
5854
  KnownHealthcareEntityCategory["AGE"] = "AGE";
@@ -5876,9 +5905,7 @@ var KnownRelationType;
5876
5905
 
5877
5906
  Object.defineProperty(exports, 'AzureKeyCredential', {
5878
5907
  enumerable: true,
5879
- get: function () {
5880
- return coreAuth.AzureKeyCredential;
5881
- }
5908
+ get: function () { return coreAuth.AzureKeyCredential; }
5882
5909
  });
5883
5910
  exports.TextAnalyticsClient = TextAnalyticsClient;
5884
5911
  //# sourceMappingURL=index.js.map