@azure/ai-text-analytics 5.1.1-alpha.20210730.2 → 5.1.1-alpha.20220725.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 (71) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +14 -13
  3. package/dist/index.js +775 -367
  4. package/dist/index.js.map +1 -1
  5. package/dist-esm/src/analyzeActionsResult.js +9 -9
  6. package/dist-esm/src/analyzeActionsResult.js.map +1 -1
  7. package/dist-esm/src/analyzeHealthcareEntitiesResult.js +4 -4
  8. package/dist-esm/src/analyzeHealthcareEntitiesResult.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 +2 -2
  14. package/dist-esm/src/azureKeyCredentialPolicy.js.map +1 -1
  15. package/dist-esm/src/constants.js +7 -0
  16. package/dist-esm/src/constants.js.map +1 -0
  17. package/dist-esm/src/detectLanguageResult.js +1 -1
  18. package/dist-esm/src/detectLanguageResult.js.map +1 -1
  19. package/dist-esm/src/detectLanguageResultArray.js +1 -1
  20. package/dist-esm/src/detectLanguageResultArray.js.map +1 -1
  21. package/dist-esm/src/extractKeyPhrasesResult.js +1 -1
  22. package/dist-esm/src/extractKeyPhrasesResult.js.map +1 -1
  23. package/dist-esm/src/extractKeyPhrasesResultArray.js +1 -1
  24. package/dist-esm/src/extractKeyPhrasesResultArray.js.map +1 -1
  25. package/dist-esm/src/generated/generatedClient.js +41 -3
  26. package/dist-esm/src/generated/generatedClient.js.map +1 -1
  27. package/dist-esm/src/generated/index.js +0 -1
  28. package/dist-esm/src/generated/index.js.map +1 -1
  29. package/dist-esm/src/generated/models/index.js +514 -1
  30. package/dist-esm/src/generated/models/index.js.map +1 -1
  31. package/dist-esm/src/generated/models/mappers.js +5 -0
  32. package/dist-esm/src/generated/models/mappers.js.map +1 -1
  33. package/dist-esm/src/generated/models/parameters.js +1 -0
  34. package/dist-esm/src/generated/models/parameters.js.map +1 -1
  35. package/dist-esm/src/index.js +3 -3
  36. package/dist-esm/src/index.js.map +1 -1
  37. package/dist-esm/src/lro/analyze/operation.js +29 -71
  38. package/dist-esm/src/lro/analyze/operation.js.map +1 -1
  39. package/dist-esm/src/lro/analyze/poller.js +3 -3
  40. package/dist-esm/src/lro/analyze/poller.js.map +1 -1
  41. package/dist-esm/src/lro/health/operation.js +41 -82
  42. package/dist-esm/src/lro/health/operation.js.map +1 -1
  43. package/dist-esm/src/lro/health/poller.js +3 -3
  44. package/dist-esm/src/lro/health/poller.js.map +1 -1
  45. package/dist-esm/src/lro/poller.js +1 -1
  46. package/dist-esm/src/lro/poller.js.map +1 -1
  47. package/dist-esm/src/recognizeCategorizedEntitiesResult.js +1 -1
  48. package/dist-esm/src/recognizeCategorizedEntitiesResult.js.map +1 -1
  49. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js +1 -1
  50. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js.map +1 -1
  51. package/dist-esm/src/recognizeLinkedEntitiesResult.js +1 -1
  52. package/dist-esm/src/recognizeLinkedEntitiesResult.js.map +1 -1
  53. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js +1 -1
  54. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js.map +1 -1
  55. package/dist-esm/src/recognizePiiEntitiesResult.js +1 -1
  56. package/dist-esm/src/recognizePiiEntitiesResult.js.map +1 -1
  57. package/dist-esm/src/recognizePiiEntitiesResultArray.js +1 -1
  58. package/dist-esm/src/recognizePiiEntitiesResultArray.js.map +1 -1
  59. package/dist-esm/src/textAnalyticsClient.js +69 -149
  60. package/dist-esm/src/textAnalyticsClient.js.map +1 -1
  61. package/dist-esm/src/textAnalyticsResult.js +4 -14
  62. package/dist-esm/src/textAnalyticsResult.js.map +1 -1
  63. package/dist-esm/src/util.js +44 -29
  64. package/dist-esm/src/util.js.map +1 -1
  65. package/package.json +33 -35
  66. package/types/ai-text-analytics.d.ts +70 -31
  67. package/CHANGELOG.md +0 -144
  68. package/dist-esm/src/generated/generatedClientContext.js +0 -42
  69. package/dist-esm/src/generated/generatedClientContext.js.map +0 -1
  70. package/dist-esm/src/tracing.js +0 -12
  71. package/dist-esm/src/tracing.js.map +0 -1
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,34 @@ var url = require('url');
12
11
  var coreTracing = require('@azure/core-tracing');
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 coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
33
+ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
34
+
35
+ // Copyright (c) Microsoft Corporation.
36
+ // Licensed under the MIT license.
37
+ /**
38
+ * @internal
39
+ */
40
+ const SDK_VERSION = "5.1.1";
41
+
15
42
  /*
16
43
  * Copyright (c) Microsoft Corporation.
17
44
  * Licensed under the MIT License.
@@ -208,6 +235,7 @@ const EntitiesTaskParameters = {
208
235
  }
209
236
  },
210
237
  loggingOptOut: {
238
+ defaultValue: false,
211
239
  serializedName: "loggingOptOut",
212
240
  type: {
213
241
  name: "Boolean"
@@ -314,6 +342,7 @@ const KeyPhrasesTaskParameters = {
314
342
  }
315
343
  },
316
344
  loggingOptOut: {
345
+ defaultValue: false,
317
346
  serializedName: "loggingOptOut",
318
347
  type: {
319
348
  name: "Boolean"
@@ -350,6 +379,7 @@ const EntityLinkingTaskParameters = {
350
379
  }
351
380
  },
352
381
  loggingOptOut: {
382
+ defaultValue: false,
353
383
  serializedName: "loggingOptOut",
354
384
  type: {
355
385
  name: "Boolean"
@@ -392,12 +422,14 @@ const SentimentAnalysisTaskParameters = {
392
422
  }
393
423
  },
394
424
  loggingOptOut: {
425
+ defaultValue: false,
395
426
  serializedName: "loggingOptOut",
396
427
  type: {
397
428
  name: "Boolean"
398
429
  }
399
430
  },
400
431
  opinionMining: {
432
+ defaultValue: false,
401
433
  serializedName: "opinionMining",
402
434
  type: {
403
435
  name: "Boolean"
@@ -2621,6 +2653,7 @@ const top = {
2621
2653
  const skip = {
2622
2654
  parameterPath: ["options", "skip"],
2623
2655
  mapper: {
2656
+ defaultValue: 0,
2624
2657
  constraints: {
2625
2658
  InclusiveMinimum: 0
2626
2659
  },
@@ -2720,14 +2753,15 @@ const opinionMining = {
2720
2753
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
2721
2754
  */
2722
2755
  /** @internal */
2723
- class GeneratedClientContext extends coreClient.ServiceClient {
2756
+ class GeneratedClient extends coreClient__namespace.ServiceClient {
2724
2757
  /**
2725
- * Initializes a new instance of the GeneratedClientContext class.
2758
+ * Initializes a new instance of the GeneratedClient class.
2726
2759
  * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example:
2727
2760
  * https://westus.api.cognitive.microsoft.com).
2728
2761
  * @param options The parameter options
2729
2762
  */
2730
2763
  constructor(endpoint, options) {
2764
+ var _a, _b;
2731
2765
  if (endpoint === undefined) {
2732
2766
  throw new Error("'endpoint' cannot be null");
2733
2767
  }
@@ -2738,39 +2772,35 @@ class GeneratedClientContext extends coreClient.ServiceClient {
2738
2772
  const defaults = {
2739
2773
  requestContentType: "application/json; charset=utf-8"
2740
2774
  };
2741
- const packageDetails = `azsdk-js-ai-text-analytics/5.1.0`;
2775
+ const packageDetails = `azsdk-js-ai-text-analytics/5.1.1`;
2742
2776
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2743
2777
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2744
2778
  : `${packageDetails}`;
2745
2779
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
2746
2780
  userAgentPrefix
2747
- }, baseUri: options.endpoint || "{Endpoint}/text/analytics/{ApiVersion}" });
2781
+ }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{Endpoint}/text/analytics/{ApiVersion}" });
2748
2782
  super(optionsWithDefaults);
2783
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
2784
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
2785
+ const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
2786
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
2787
+ if (!bearerTokenAuthenticationPolicyFound) {
2788
+ this.pipeline.removePolicy({
2789
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
2790
+ });
2791
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2792
+ scopes: `${optionsWithDefaults.baseUri}/.default`,
2793
+ challengeCallbacks: {
2794
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2795
+ }
2796
+ }));
2797
+ }
2798
+ }
2749
2799
  // Parameter assignments
2750
2800
  this.endpoint = endpoint;
2751
2801
  // Assigning values to Constant parameters
2752
2802
  this.apiVersion = options.apiVersion || "v3.1";
2753
2803
  }
2754
- }
2755
-
2756
- /*
2757
- * Copyright (c) Microsoft Corporation.
2758
- * Licensed under the MIT License.
2759
- *
2760
- * Code generated by Microsoft (R) AutoRest Code Generator.
2761
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
2762
- */
2763
- /** @internal */
2764
- class GeneratedClient extends GeneratedClientContext {
2765
- /**
2766
- * Initializes a new instance of the GeneratedClient class.
2767
- * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example:
2768
- * https://westus.api.cognitive.microsoft.com).
2769
- * @param options The parameter options
2770
- */
2771
- constructor(endpoint, options) {
2772
- super(endpoint, options);
2773
- }
2774
2804
  /**
2775
2805
  * Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed.
2776
2806
  * @param options The options parameters.
@@ -2879,7 +2909,7 @@ class GeneratedClient extends GeneratedClientContext {
2879
2909
  }
2880
2910
  }
2881
2911
  // Operation Specifications
2882
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
2912
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
2883
2913
  const analyzeOperationSpec = {
2884
2914
  path: "/analyze",
2885
2915
  httpMethod: "POST",
@@ -3166,7 +3196,7 @@ function parseAssessmentIndex(pointer) {
3166
3196
  const assessmentIndex = {
3167
3197
  document: parseInt(res[1]),
3168
3198
  sentence: parseInt(res[2]),
3169
- assessment: parseInt(res[3])
3199
+ assessment: parseInt(res[3]),
3170
3200
  };
3171
3201
  return assessmentIndex;
3172
3202
  }
@@ -3250,7 +3280,7 @@ function nextLinkToTopAndSkip(nextLink) {
3250
3280
  }
3251
3281
  return {
3252
3282
  skip: skip,
3253
- top: top
3283
+ top: top,
3254
3284
  };
3255
3285
  }
3256
3286
  /**
@@ -3260,32 +3290,55 @@ function getOperationId(operationLocation) {
3260
3290
  const lastSlashIndex = operationLocation.lastIndexOf("/");
3261
3291
  return operationLocation.substring(lastSlashIndex + 1);
3262
3292
  }
3293
+ function appendReadableErrorMessage(currentMessage, innerMessage) {
3294
+ let message = currentMessage;
3295
+ if (message.slice(-1) !== ".") {
3296
+ message = message + ".";
3297
+ }
3298
+ return message + " " + innerMessage;
3299
+ }
3263
3300
  /**
3264
3301
  * @internal
3265
- * parses incoming errors from the service and if the inner error code is
3266
- * InvalidDocumentBatch, it exposes that as the statusCode instead.
3302
+ * parses incoming errors from the service/
3267
3303
  * @param error - the incoming error
3268
3304
  */
3269
- function handleInvalidDocumentBatch(error) {
3270
- var _a, _b, _c, _d, _e, _f, _g, _h;
3271
- const castError = error;
3272
- const innerCode = (_d = (_c = (_b = (_a = castError.response) === null || _a === void 0 ? void 0 : _a.parsedBody) === null || _b === void 0 ? void 0 : _b.error) === null || _c === void 0 ? void 0 : _c.innererror) === null || _d === void 0 ? void 0 : _d.code;
3273
- const innerMessage = (_h = (_g = (_f = (_e = castError.response) === null || _e === void 0 ? void 0 : _e.parsedBody) === null || _f === void 0 ? void 0 : _f.error) === null || _g === void 0 ? void 0 : _g.innererror) === null || _h === void 0 ? void 0 : _h.message;
3274
- if (innerMessage) {
3275
- return innerCode === "InvalidDocumentBatch"
3276
- ? new coreRestPipeline.RestError(innerMessage, { code: innerCode, statusCode: castError.statusCode })
3277
- : error;
3278
- }
3279
- else {
3280
- // unfortunately, the service currently does not follow the swagger definition
3281
- // for errors in some cases.
3282
- // Issue: https://msazure.visualstudio.com/Cognitive%20Services/_workitems/edit/8775003/?workitem=8972164
3283
- // throw new Error(
3284
- // `The error coming from the service does not follow the expected structure: ${error}`
3285
- // );
3286
- logger.warning(`The error coming from the service does not follow the expected structure: ${error}`);
3305
+ function transformError(errorResponse) {
3306
+ var _a;
3307
+ const strongErrorResponse = errorResponse;
3308
+ if (!strongErrorResponse.response) {
3309
+ throw errorResponse;
3310
+ }
3311
+ const topLevelError = (_a = strongErrorResponse.response.parsedBody) === null || _a === void 0 ? void 0 : _a.error;
3312
+ if (!topLevelError)
3313
+ return errorResponse;
3314
+ let errorMessage = topLevelError.message;
3315
+ let code = topLevelError.code;
3316
+ function unwrap(error) {
3317
+ const innerError = error.innererror;
3318
+ if (innerError) {
3319
+ if (innerError.message) {
3320
+ errorMessage = appendReadableErrorMessage(errorMessage, innerError.message);
3321
+ }
3322
+ if (innerError.code) {
3323
+ code = innerError.code;
3324
+ }
3325
+ return unwrap(innerError);
3326
+ }
3287
3327
  return error;
3288
3328
  }
3329
+ unwrap(topLevelError);
3330
+ return new coreRestPipeline.RestError(errorMessage, {
3331
+ code: code === "InvalidDocumentBatch" ? code : topLevelError.code,
3332
+ statusCode: strongErrorResponse.statusCode,
3333
+ });
3334
+ }
3335
+ async function throwError(p) {
3336
+ try {
3337
+ return await p;
3338
+ }
3339
+ catch (e) {
3340
+ throw transformError(e);
3341
+ }
3289
3342
  }
3290
3343
  /**
3291
3344
  * A wrapper for setTimeout that resolves a promise after t milliseconds.
@@ -3318,7 +3371,7 @@ function intoTextAnalyticsError(errorModel) {
3318
3371
  return {
3319
3372
  code: errorModel.code,
3320
3373
  message: errorModel.message,
3321
- target: errorModel.target
3374
+ target: errorModel.target,
3322
3375
  };
3323
3376
  }
3324
3377
  /**
@@ -3328,7 +3381,7 @@ function makeTextAnalyticsSuccessResult(id, warnings, statistics) {
3328
3381
  return {
3329
3382
  id,
3330
3383
  statistics,
3331
- warnings
3384
+ warnings,
3332
3385
  };
3333
3386
  }
3334
3387
  /**
@@ -3337,7 +3390,7 @@ function makeTextAnalyticsSuccessResult(id, warnings, statistics) {
3337
3390
  function makeTextAnalyticsErrorResult(id, error) {
3338
3391
  return {
3339
3392
  id,
3340
- error: intoTextAnalyticsError(error)
3393
+ error: intoTextAnalyticsError(error),
3341
3394
  };
3342
3395
  }
3343
3396
  /**
@@ -3365,7 +3418,7 @@ function combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(inp
3365
3418
  const sorted = processAndCombineSuccessfulAndErroneousDocuments(input, response, processSuccess, processError);
3366
3419
  return Object.assign(sorted, {
3367
3420
  statistics: response.statistics,
3368
- modelVersion: response.modelVersion
3421
+ modelVersion: response.modelVersion,
3369
3422
  });
3370
3423
  }
3371
3424
 
@@ -3421,7 +3474,7 @@ function makeRecognizeCategorizedEntitiesResultArray(input, response) {
3421
3474
  * @internal
3422
3475
  */
3423
3476
  function makeAnalyzeSentimentResult(result) {
3424
- const { id, sentiment, confidenceScores, sentenceSentiments: sentences, warnings, statistics } = result;
3477
+ const { id, sentiment, confidenceScores, sentenceSentiments: sentences, warnings, statistics, } = result;
3425
3478
  return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { sentiment,
3426
3479
  confidenceScores, sentences: sentences.map((sentence) => convertGeneratedSentenceSentiment(sentence, result)) });
3427
3480
  }
@@ -3454,13 +3507,13 @@ function convertGeneratedSentenceSentiment(sentence, result) {
3454
3507
  sentiment: target.sentiment,
3455
3508
  text: target.text,
3456
3509
  offset: target.offset,
3457
- length: target.length
3510
+ length: target.length,
3458
3511
  },
3459
3512
  assessments: target.relations
3460
3513
  .filter((relation) => relation.relationType === "assessment")
3461
- .map((relation) => convertTargetRelationToAssessmentSentiment(relation, result))
3514
+ .map((relation) => convertTargetRelationToAssessmentSentiment(relation, result)),
3462
3515
  }))
3463
- : []
3516
+ : [],
3464
3517
  };
3465
3518
  }
3466
3519
  /**
@@ -3564,16 +3617,6 @@ function makeRecognizeLinkedEntitiesResultArray(input, response) {
3564
3617
  return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(input, response, makeRecognizeLinkedEntitiesResult, makeRecognizeLinkedEntitiesErrorResult);
3565
3618
  }
3566
3619
 
3567
- // Copyright (c) Microsoft Corporation.
3568
- /**
3569
- * Creates a span using the global tracer.
3570
- * @internal
3571
- */
3572
- const createSpan = coreTracing.createSpanFunction({
3573
- packagePrefix: "Azure.CognitiveServices.TextAnalytics",
3574
- namespace: "Microsoft.CognitiveServices"
3575
- });
3576
-
3577
3620
  // Copyright (c) Microsoft Corporation.
3578
3621
  // Licensed under the MIT license.
3579
3622
  const API_KEY_HEADER_NAME = "Ocp-Apim-Subscription-Key";
@@ -3592,7 +3635,7 @@ function textAnalyticsAzureKeyCredentialPolicy(credential) {
3592
3635
  sendRequest(request, next) {
3593
3636
  request.headers.set(API_KEY_HEADER_NAME, credential.key);
3594
3637
  return next(request);
3595
- }
3638
+ },
3596
3639
  };
3597
3640
  }
3598
3641
 
@@ -3629,7 +3672,7 @@ class AnalysisPollOperation {
3629
3672
  */
3630
3673
  toString() {
3631
3674
  return JSON.stringify({
3632
- state: this.state
3675
+ state: this.state,
3633
3676
  });
3634
3677
  }
3635
3678
  }
@@ -3652,7 +3695,7 @@ function makeHealthcareEntitiesWithoutNeighbors(entity) {
3652
3695
  text,
3653
3696
  normalizedText: name,
3654
3697
  subCategory: subcategory,
3655
- dataSources: (_a = links === null || links === void 0 ? void 0 : links.map(({ dataSource, id }) => ({ name: dataSource, entityId: id }))) !== null && _a !== void 0 ? _a : []
3698
+ dataSources: (_a = links === null || links === void 0 ? void 0 : links.map(({ dataSource, id }) => ({ name: dataSource, entityId: id }))) !== null && _a !== void 0 ? _a : [],
3656
3699
  };
3657
3700
  }
3658
3701
  /**
@@ -3663,8 +3706,8 @@ function makeHealthcareRelations(entities, relations) {
3663
3706
  relationType: relation.relationType,
3664
3707
  roles: relation.entities.map((role) => ({
3665
3708
  entity: entities[parseHealthcareEntityIndex(role.ref)],
3666
- name: role.role
3667
- }))
3709
+ name: role.role,
3710
+ })),
3668
3711
  }));
3669
3712
  }
3670
3713
  /**
@@ -3688,12 +3731,12 @@ function makeHealthcareEntitiesErrorResult(id, error) {
3688
3731
  /**
3689
3732
  * @internal
3690
3733
  */
3691
- function getMetaInfoFromResponse(response) {
3734
+ function getMetaInfoFromResponse$1(response) {
3692
3735
  return {
3693
3736
  createdOn: response.createdDateTime,
3694
3737
  lastModifiedOn: response.lastUpdateDateTime,
3695
3738
  expiresOn: response.expirationDateTime,
3696
- status: response.status
3739
+ status: response.status,
3697
3740
  };
3698
3741
  }
3699
3742
  /**
@@ -3703,10 +3746,11 @@ function getMetaInfoFromResponse(response) {
3703
3746
  class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3704
3747
  constructor(state,
3705
3748
  // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters
3706
- client, documents, options = {}) {
3749
+ client, tracing, documents, options = {}) {
3707
3750
  super(state);
3708
3751
  this.state = state;
3709
3752
  this.client = client;
3753
+ this.tracing = tracing;
3710
3754
  this.documents = documents;
3711
3755
  this.options = options;
3712
3756
  }
@@ -3727,7 +3771,7 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3727
3771
  byPage: (settings) => {
3728
3772
  const pageOptions = Object.assign(Object.assign({}, options), { top: settings === null || settings === void 0 ? void 0 : settings.maxPageSize });
3729
3773
  return this._listHealthcareEntitiesPaged(operationId, pageOptions);
3730
- }
3774
+ },
3731
3775
  };
3732
3776
  }
3733
3777
  /**
@@ -3769,27 +3813,14 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3769
3813
  * returns an iterator to arrays of the sorted results of a healthcare operation.
3770
3814
  */
3771
3815
  async _listHealthcareEntitiesSinglePage(operationId, options) {
3772
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-_listHealthcareEntitiesSinglePage", options || {});
3773
- try {
3774
- const response = await this.client.healthStatus(operationId, finalOptions);
3775
- if (response.results) {
3776
- const result = processAndCombineSuccessfulAndErroneousDocuments(this.documents, response.results, makeHealthcareEntitiesResult, makeHealthcareEntitiesErrorResult);
3777
- return response.nextLink
3778
- ? Object.assign({ result }, nextLinkToTopAndSkip(response.nextLink)) : { result };
3779
- }
3780
- else {
3781
- throw new Error("Healthcare action has succeeded but the there are no results!");
3782
- }
3783
- }
3784
- catch (e) {
3785
- span.setStatus({
3786
- code: coreTracing.SpanStatusCode.ERROR,
3787
- message: e.message
3788
- });
3789
- throw e;
3816
+ const response = await this.tracing.withSpan("TextAnalyticsClient-_listHealthcareEntitiesSinglePage", options || {}, (finalOptions) => this.client.healthStatus(operationId, finalOptions));
3817
+ if (response.results) {
3818
+ const result = processAndCombineSuccessfulAndErroneousDocuments(this.documents, response.results, makeHealthcareEntitiesResult, makeHealthcareEntitiesErrorResult);
3819
+ return response.nextLink
3820
+ ? Object.assign({ result }, nextLinkToTopAndSkip(response.nextLink)) : { result };
3790
3821
  }
3791
- finally {
3792
- span.end();
3822
+ else {
3823
+ throw new Error("Healthcare action has succeeded but the there are no results!");
3793
3824
  }
3794
3825
  }
3795
3826
  /**
@@ -3798,61 +3829,34 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3798
3829
  */
3799
3830
  async getHealthStatus(operationId, options) {
3800
3831
  var _a;
3801
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-getHealthStatus", options || {});
3802
- try {
3803
- const response = await this.client.healthStatus(operationId, finalOptions);
3804
- switch (response.status) {
3805
- case "notStarted":
3806
- case "running":
3807
- break;
3808
- case "failed": {
3809
- const errors = (_a = response.errors) === null || _a === void 0 ? void 0 : _a.map((e) => ` code ${e.code}, message: '${e.message}'`).join("\n");
3810
- const message = `Healthcare analysis failed. Error(s): ${errors || ""}`;
3811
- throw new Error(message);
3812
- }
3813
- default: {
3814
- if (response.results) {
3815
- return {
3816
- done: true,
3817
- statistics: response.results.statistics,
3818
- modelVersion: response.results.modelVersion,
3819
- operationMetdata: getMetaInfoFromResponse(response)
3820
- };
3821
- }
3822
- else {
3823
- throw new Error("Healthcare action has finished but the there are no results!");
3824
- }
3832
+ const response = await this.tracing.withSpan("TextAnalyticsClient-getHealthStatus", options || {}, (finalOptions) => this.client.healthStatus(operationId, finalOptions));
3833
+ switch (response.status) {
3834
+ case "notStarted":
3835
+ case "running":
3836
+ break;
3837
+ case "failed": {
3838
+ const errors = (_a = response.errors) === null || _a === void 0 ? void 0 : _a.map((e) => ` code ${e.code}, message: '${e.message}'`).join("\n");
3839
+ const message = `Healthcare analysis failed. Error(s): ${errors || ""}`;
3840
+ throw new Error(message);
3841
+ }
3842
+ default: {
3843
+ if (response.results) {
3844
+ return {
3845
+ done: true,
3846
+ statistics: response.results.statistics,
3847
+ modelVersion: response.results.modelVersion,
3848
+ operationMetdata: getMetaInfoFromResponse$1(response),
3849
+ };
3850
+ }
3851
+ else {
3852
+ throw new Error("Healthcare action has finished but the there are no results!");
3825
3853
  }
3826
3854
  }
3827
- return { done: false, operationMetdata: getMetaInfoFromResponse(response) };
3828
- }
3829
- catch (e) {
3830
- span.setStatus({
3831
- code: coreTracing.SpanStatusCode.ERROR,
3832
- message: e.message
3833
- });
3834
- throw e;
3835
- }
3836
- finally {
3837
- span.end();
3838
3855
  }
3856
+ return { done: false, operationMetdata: getMetaInfoFromResponse$1(response) };
3839
3857
  }
3840
3858
  async beginAnalyzeHealthcare(documents, options) {
3841
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-beginAnalyzeHealthcare", addStrEncodingParam(options || {}));
3842
- try {
3843
- return await this.client.health({ documents: documents }, finalOptions);
3844
- }
3845
- catch (e) {
3846
- const exception = handleInvalidDocumentBatch(e);
3847
- span.setStatus({
3848
- code: coreTracing.SpanStatusCode.ERROR,
3849
- message: exception.message
3850
- });
3851
- throw exception;
3852
- }
3853
- finally {
3854
- span.end();
3855
- }
3859
+ return this.tracing.withSpan("TextAnalyticsClient-beginAnalyzeHealthcare", addStrEncodingParam(options || {}), (finalOptions) => throwError(this.client.health({ documents: documents }, finalOptions)));
3856
3860
  }
3857
3861
  async update(options = {}) {
3858
3862
  const state = this.state;
@@ -3865,7 +3869,7 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3865
3869
  abortSignal: updatedAbortSignal ? updatedAbortSignal : options.abortSignal,
3866
3870
  modelVersion: this.options.modelVersion,
3867
3871
  stringIndexType: this.options.stringIndexType,
3868
- loggingOptOut: this.options.disableServiceLogs
3872
+ loggingOptOut: this.options.disableServiceLogs,
3869
3873
  });
3870
3874
  if (!response.operationLocation) {
3871
3875
  throw new Error("Expects a valid 'operationLocation' to retrieve health results but did not find any");
@@ -3877,7 +3881,7 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3877
3881
  includeStatistics: this.options.includeStatistics,
3878
3882
  tracingOptions: this.options.tracingOptions,
3879
3883
  onResponse: this.options.onResponse,
3880
- serializerOptions: this.options.serializerOptions
3884
+ serializerOptions: this.options.serializerOptions,
3881
3885
  });
3882
3886
  state.createdOn = operationStatus.operationMetdata.createdOn;
3883
3887
  state.expiresOn = operationStatus.operationMetdata.expiresOn;
@@ -3886,11 +3890,11 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3886
3890
  if (!state.isCompleted && operationStatus.done) {
3887
3891
  const pagedIterator = this.listHealthcareEntitiesByPage(state.operationId, {
3888
3892
  abortSignal: this.options.abortSignal,
3889
- tracingOptions: this.options.tracingOptions
3893
+ tracingOptions: this.options.tracingOptions,
3890
3894
  });
3891
3895
  state.result = Object.assign(pagedIterator, {
3892
3896
  statistics: operationStatus.statistics,
3893
- modelVersion: operationStatus.modelVersion
3897
+ modelVersion: operationStatus.modelVersion,
3894
3898
  });
3895
3899
  state.isCompleted = true;
3896
3900
  }
@@ -3904,7 +3908,7 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3904
3908
  if (state.operationId) {
3905
3909
  await this.client.cancelHealthJob(state.operationId, {
3906
3910
  abortSignal: this.options.abortSignal,
3907
- tracingOptions: this.options.tracingOptions
3911
+ tracingOptions: this.options.tracingOptions,
3908
3912
  });
3909
3913
  }
3910
3914
  state.isCancelled = true;
@@ -3920,12 +3924,12 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3920
3924
  class BeginAnalyzeHealthcarePoller extends AnalysisPoller {
3921
3925
  // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters
3922
3926
  constructor(inputs) {
3923
- const { client, documents, options, updateIntervalInMs = 5000, resumeFrom } = inputs;
3927
+ const { client, tracing, documents, options, updateIntervalInMs = 5000, resumeFrom } = inputs;
3924
3928
  let state;
3925
3929
  if (resumeFrom) {
3926
3930
  state = JSON.parse(resumeFrom).state;
3927
3931
  }
3928
- const operation = new BeginAnalyzeHealthcarePollerOperation((state || {}), client, documents, options);
3932
+ const operation = new BeginAnalyzeHealthcarePollerOperation((state || {}), client, tracing, documents, options);
3929
3933
  super(operation);
3930
3934
  this.updateIntervalInMs = updateIntervalInMs;
3931
3935
  }
@@ -3978,7 +3982,7 @@ function parseActionError(erredActions) {
3978
3982
  code: erredActions.code,
3979
3983
  message: erredActions.message,
3980
3984
  index: parseInt(result[2]),
3981
- type: convertTaskTypeToActionType(result[1])
3985
+ type: convertTaskTypeToActionType(result[1]),
3982
3986
  };
3983
3987
  }
3984
3988
  else {
@@ -4050,8 +4054,8 @@ function makeActionResult(documents, makeResultsArray, succeededTasks, erredActi
4050
4054
  ...actions,
4051
4055
  {
4052
4056
  results: recognizeEntitiesResults,
4053
- completedOn: lastUpdateDateTime
4054
- }
4057
+ completedOn: lastUpdateDateTime,
4058
+ },
4055
4059
  ];
4056
4060
  }
4057
4061
  else {
@@ -4080,7 +4084,7 @@ function createAnalyzeActionsResult(response, documents) {
4080
4084
  recognizePiiEntitiesResults: makeActionResult(documents, makeRecognizePiiEntitiesResultArray, (_c = response.tasks.entityRecognitionPiiTasks) !== null && _c !== void 0 ? _c : [], recognizePiiEntitiesActionErrors),
4081
4085
  extractKeyPhrasesResults: makeActionResult(documents, makeExtractKeyPhrasesResultArray, (_d = response.tasks.keyPhraseExtractionTasks) !== null && _d !== void 0 ? _d : [], extractKeyPhrasesActionErrors),
4082
4086
  recognizeLinkedEntitiesResults: makeActionResult(documents, makeRecognizeLinkedEntitiesResultArray, (_e = response.tasks.entityLinkingTasks) !== null && _e !== void 0 ? _e : [], recognizeLinkedEntitiesActionErrors),
4083
- analyzeSentimentResults: makeActionResult(documents, makeAnalyzeSentimentResultArray, (_f = response.tasks.sentimentAnalysisTasks) !== null && _f !== void 0 ? _f : [], analyzeSentimentActionErrors)
4087
+ analyzeSentimentResults: makeActionResult(documents, makeAnalyzeSentimentResultArray, (_f = response.tasks.sentimentAnalysisTasks) !== null && _f !== void 0 ? _f : [], analyzeSentimentActionErrors),
4084
4088
  };
4085
4089
  }
4086
4090
 
@@ -4088,7 +4092,7 @@ function createAnalyzeActionsResult(response, documents) {
4088
4092
  /**
4089
4093
  * @internal
4090
4094
  */
4091
- function getMetaInfoFromResponse$1(response) {
4095
+ function getMetaInfoFromResponse(response) {
4092
4096
  return {
4093
4097
  createdOn: response.createdDateTime,
4094
4098
  lastModifiedOn: response.lastUpdateDateTime,
@@ -4097,7 +4101,7 @@ function getMetaInfoFromResponse$1(response) {
4097
4101
  actionsSucceededCount: response.tasks.completed,
4098
4102
  actionsFailedCount: response.tasks.failed,
4099
4103
  actionsInProgressCount: response.tasks.inProgress,
4100
- displayName: response.displayName
4104
+ displayName: response.displayName,
4101
4105
  };
4102
4106
  }
4103
4107
  /**
@@ -4108,10 +4112,11 @@ function getMetaInfoFromResponse$1(response) {
4108
4112
  class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4109
4113
  constructor(state,
4110
4114
  // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters
4111
- client, documents, actions, options = {}) {
4115
+ client, tracing, documents, actions, options = {}) {
4112
4116
  super(state);
4113
4117
  this.state = state;
4114
4118
  this.client = client;
4119
+ this.tracing = tracing;
4115
4120
  this.documents = documents;
4116
4121
  this.actions = actions;
4117
4122
  this.options = options;
@@ -4133,7 +4138,7 @@ class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4133
4138
  byPage: (settings) => {
4134
4139
  const pageOptions = Object.assign(Object.assign({}, options), { top: settings === null || settings === void 0 ? void 0 : settings.maxPageSize });
4135
4140
  return this._listAnalyzeActionsResultsPaged(operationId, pageOptions);
4136
- }
4141
+ },
4137
4142
  };
4138
4143
  }
4139
4144
  /**
@@ -4154,77 +4159,36 @@ class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4154
4159
  * returns an iterator to arrays of the sorted results of an analyze actions operation.
4155
4160
  */
4156
4161
  async _listAnalyzeActionsResultsSinglePage(operationId, options) {
4157
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-_listAnalyzeActionsResultsSinglePage", options || {});
4158
- try {
4159
- const response = await this.client.analyzeStatus(operationId, finalOptions);
4160
- const result = createAnalyzeActionsResult(response, this.documents);
4161
- return response.nextLink
4162
- ? Object.assign({ result }, nextLinkToTopAndSkip(response.nextLink)) : { result };
4163
- }
4164
- catch (e) {
4165
- span.setStatus({
4166
- code: coreTracing.SpanStatusCode.ERROR,
4167
- message: e.message
4168
- });
4169
- throw e;
4170
- }
4171
- finally {
4172
- span.end();
4173
- }
4162
+ const response = await this.tracing.withSpan("TextAnalyticsClient-_listAnalyzeActionsResultsSinglePage", options || {}, (finalOptions) => this.client.analyzeStatus(operationId, finalOptions));
4163
+ const result = createAnalyzeActionsResult(response, this.documents);
4164
+ return response.nextLink ? Object.assign({ result }, nextLinkToTopAndSkip(response.nextLink)) : { result };
4174
4165
  }
4175
4166
  /**
4176
4167
  * returns whether the analyze actions operation is done and if so returns also
4177
4168
  * statistics.
4178
4169
  */
4179
4170
  async getAnalyzeActionsOperationStatus(operationId, options) {
4180
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-getAnalyzeActionsOperationStatus", options || {});
4181
- try {
4182
- const response = await this.client.analyzeStatus(operationId, finalOptions);
4183
- switch (response.status) {
4184
- case "notStarted":
4185
- case "running":
4186
- break;
4187
- default: {
4188
- return {
4189
- done: true,
4190
- statistics: response.statistics,
4191
- operationMetdata: getMetaInfoFromResponse$1(response)
4192
- };
4193
- }
4171
+ const response = await this.tracing.withSpan("TextAnalyticsClient-getAnalyzeActionsOperationStatus", options || {}, (finalOptions) => this.client.analyzeStatus(operationId, finalOptions));
4172
+ switch (response.status) {
4173
+ case "notStarted":
4174
+ case "running":
4175
+ break;
4176
+ default: {
4177
+ return {
4178
+ done: true,
4179
+ statistics: response.statistics,
4180
+ operationMetdata: getMetaInfoFromResponse(response),
4181
+ };
4194
4182
  }
4195
- return { done: false, operationMetdata: getMetaInfoFromResponse$1(response) };
4196
- }
4197
- catch (e) {
4198
- span.setStatus({
4199
- code: coreTracing.SpanStatusCode.ERROR,
4200
- message: e.message
4201
- });
4202
- throw e;
4203
- }
4204
- finally {
4205
- span.end();
4206
4183
  }
4184
+ return { done: false, operationMetdata: getMetaInfoFromResponse(response) };
4207
4185
  }
4208
4186
  async beginAnalyzeActions(documents, actions, options) {
4209
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-beginAnalyze", options || {});
4210
- try {
4211
- return await this.client.analyze(Object.assign({ body: {
4212
- analysisInput: { documents: documents },
4213
- tasks: actions,
4214
- displayName: options === null || options === void 0 ? void 0 : options.displayName
4215
- } }, finalOptions));
4216
- }
4217
- catch (e) {
4218
- const exception = handleInvalidDocumentBatch(e);
4219
- span.setStatus({
4220
- code: coreTracing.SpanStatusCode.ERROR,
4221
- message: exception.message
4222
- });
4223
- throw exception;
4224
- }
4225
- finally {
4226
- span.end();
4227
- }
4187
+ return this.tracing.withSpan("TextAnalyticsClient-beginAnalyze", options || {}, (finalOptions) => throwError(this.client.analyze(Object.assign({ body: {
4188
+ analysisInput: { documents: documents },
4189
+ tasks: actions,
4190
+ displayName: options === null || options === void 0 ? void 0 : options.displayName,
4191
+ } }, finalOptions))));
4228
4192
  }
4229
4193
  async update(options = {}) {
4230
4194
  var _a;
@@ -4236,7 +4200,7 @@ class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4236
4200
  displayName: this.options.displayName,
4237
4201
  tracingOptions: this.options.tracingOptions,
4238
4202
  requestOptions: this.options.requestOptions,
4239
- abortSignal: updatedAbortSignal ? updatedAbortSignal : this.options.abortSignal
4203
+ abortSignal: updatedAbortSignal ? updatedAbortSignal : this.options.abortSignal,
4240
4204
  });
4241
4205
  if (!response.operationLocation) {
4242
4206
  throw new Error("Expects a valid 'operationLocation' to retrieve analyze results but did not find any");
@@ -4246,7 +4210,7 @@ class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4246
4210
  const operationStatus = await this.getAnalyzeActionsOperationStatus(state.operationId, {
4247
4211
  abortSignal: updatedAbortSignal ? updatedAbortSignal : options.abortSignal,
4248
4212
  includeStatistics: this.options.includeStatistics,
4249
- tracingOptions: this.options.tracingOptions
4213
+ tracingOptions: this.options.tracingOptions,
4250
4214
  });
4251
4215
  state.createdOn = operationStatus.operationMetdata.createdOn;
4252
4216
  state.expiresOn = operationStatus.operationMetdata.expiresOn;
@@ -4262,7 +4226,7 @@ class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4262
4226
  tracingOptions: this.options.tracingOptions,
4263
4227
  includeStatistics: this.options.includeStatistics,
4264
4228
  onResponse: this.options.onResponse,
4265
- serializerOptions: this.options.serializerOptions
4229
+ serializerOptions: this.options.serializerOptions,
4266
4230
  });
4267
4231
  // Attach stats if the service starts to return them
4268
4232
  // https://github.com/Azure/azure-sdk-for-js/issues/14139
@@ -4293,12 +4257,12 @@ class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4293
4257
  class BeginAnalyzeActionsPoller extends AnalysisPoller {
4294
4258
  // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters
4295
4259
  constructor(pollerOptions) {
4296
- const { client, documents, actions, options, updateIntervalInMs = 5000, resumeFrom } = pollerOptions;
4260
+ const { client, tracing, documents, actions, options, updateIntervalInMs = 5000, resumeFrom, } = pollerOptions;
4297
4261
  let state;
4298
4262
  if (resumeFrom) {
4299
4263
  state = JSON.parse(resumeFrom).state;
4300
4264
  }
4301
- const operation = new BeginAnalyzeActionsPollerOperation((state || {}), client, documents, actions, options);
4265
+ const operation = new BeginAnalyzeActionsPollerOperation((state || {}), client, tracing, documents, actions, options);
4302
4266
  super(operation);
4303
4267
  this.updateIntervalInMs = updateIntervalInMs;
4304
4268
  }
@@ -4309,6 +4273,10 @@ class BeginAnalyzeActionsPoller extends AnalysisPoller {
4309
4273
 
4310
4274
  // Copyright (c) Microsoft Corporation.
4311
4275
  const DEFAULT_COGNITIVE_SCOPE = "https://cognitiveservices.azure.com/.default";
4276
+ /**
4277
+ * The types of PII domains the user can choose from.
4278
+ */
4279
+ exports.PiiEntityDomain = void 0;
4312
4280
  (function (PiiEntityDomain) {
4313
4281
  /**
4314
4282
  * @see {@link https://aka.ms/tanerpii} for more information.
@@ -4340,17 +4308,32 @@ class TextAnalyticsClient {
4340
4308
  const { defaultCountryHint = "us", defaultLanguage = "en" } = options, pipelineOptions = tslib.__rest(options, ["defaultCountryHint", "defaultLanguage"]);
4341
4309
  this.defaultCountryHint = defaultCountryHint;
4342
4310
  this.defaultLanguage = defaultLanguage;
4311
+ const libInfo = `azsdk-js-ai-textanalytics/${SDK_VERSION}`;
4312
+ if (!pipelineOptions.userAgentOptions) {
4313
+ pipelineOptions.userAgentOptions = {};
4314
+ }
4315
+ if (pipelineOptions.userAgentOptions.userAgentPrefix) {
4316
+ pipelineOptions.userAgentOptions.userAgentPrefix = `${pipelineOptions.userAgentOptions.userAgentPrefix} ${libInfo}`;
4317
+ }
4318
+ else {
4319
+ pipelineOptions.userAgentOptions.userAgentPrefix = libInfo;
4320
+ }
4343
4321
  const internalPipelineOptions = Object.assign(Object.assign({}, pipelineOptions), {
4344
4322
  loggingOptions: {
4345
4323
  logger: logger.info,
4346
- additionalAllowedHeaderNames: ["x-ms-correlation-request-id", "x-ms-request-id"]
4347
- }
4324
+ additionalAllowedHeaderNames: ["x-ms-correlation-request-id", "x-ms-request-id"],
4325
+ },
4348
4326
  });
4349
4327
  this.client = new GeneratedClient(this.endpointUrl, internalPipelineOptions);
4350
4328
  const authPolicy = coreAuth.isTokenCredential(credential)
4351
4329
  ? coreRestPipeline.bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_COGNITIVE_SCOPE })
4352
4330
  : textAnalyticsAzureKeyCredentialPolicy(credential);
4353
4331
  this.client.pipeline.addPolicy(authPolicy);
4332
+ this._tracing = coreTracing.createTracingClient({
4333
+ packageName: "@azure/ai-text-analytics",
4334
+ packageVersion: SDK_VERSION,
4335
+ namespace: "Microsoft.CognitiveServices",
4336
+ });
4354
4337
  }
4355
4338
  async detectLanguage(documents, countryHintOrOptions, options) {
4356
4339
  let realOptions;
@@ -4368,23 +4351,11 @@ class TextAnalyticsClient {
4368
4351
  realInputs = documents.map((input) => (Object.assign(Object.assign({}, input), { countryHint: input.countryHint === "none" ? "" : input.countryHint })));
4369
4352
  realOptions = countryHintOrOptions || {};
4370
4353
  }
4371
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-detectLanguages", makeGeneratedDetectLanguageOptions(realOptions));
4372
- try {
4373
- const result = await this.client.languages({
4374
- documents: realInputs
4375
- }, finalOptions);
4376
- return makeDetectLanguageResultArray(realInputs, result);
4377
- }
4378
- catch (e) {
4379
- span.setStatus({
4380
- code: coreTracing.SpanStatusCode.ERROR,
4381
- message: e.message
4382
- });
4383
- throw e;
4384
- }
4385
- finally {
4386
- span.end();
4387
- }
4354
+ return this._tracing.withSpan("TextAnalyticsClient-detectLanguages", makeGeneratedDetectLanguageOptions(realOptions), (finalOptions) => this.client
4355
+ .languages({
4356
+ documents: realInputs,
4357
+ }, finalOptions)
4358
+ .then((result) => makeDetectLanguageResultArray(realInputs, result)));
4388
4359
  }
4389
4360
  async recognizeEntities(documents, languageOrOptions,
4390
4361
  // eslint-disable-next-line @azure/azure-sdk/ts-naming-options
@@ -4403,32 +4374,9 @@ class TextAnalyticsClient {
4403
4374
  realInputs = documents;
4404
4375
  realOptions = languageOrOptions || {};
4405
4376
  }
4406
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizeEntities", makeGeneratedRecognizeCategorizedEntitiesOptions(realOptions));
4407
- try {
4408
- const result = await this.client.entitiesRecognitionGeneral({
4409
- documents: realInputs
4410
- }, finalOptions);
4411
- return makeRecognizeCategorizedEntitiesResultArray(realInputs, result);
4412
- }
4413
- catch (e) {
4414
- /**
4415
- * This special logic handles REST exception with code
4416
- * InvalidDocumentBatch and is needed to maintain backward compatability
4417
- * with sdk v5.0.0 and earlier. In general, REST exceptions are thrown as
4418
- * is and include both outer and inner exception codes. However, the
4419
- * earlier versions were throwing an exception that included the inner
4420
- * code only.
4421
- */
4422
- const backwardCompatibleException = handleInvalidDocumentBatch(e);
4423
- span.setStatus({
4424
- code: coreTracing.SpanStatusCode.ERROR,
4425
- message: backwardCompatibleException.message
4426
- });
4427
- throw backwardCompatibleException;
4428
- }
4429
- finally {
4430
- span.end();
4431
- }
4377
+ return this._tracing.withSpan("TextAnalyticsClient-recognizeEntities", makeGeneratedRecognizeCategorizedEntitiesOptions(realOptions), (finalOptions) => throwError(this.client.entitiesRecognitionGeneral({
4378
+ documents: realInputs,
4379
+ }, finalOptions)).then((result) => makeRecognizeCategorizedEntitiesResultArray(realInputs, result)));
4432
4380
  }
4433
4381
  async analyzeSentiment(documents, languageOrOptions, options) {
4434
4382
  let realOptions;
@@ -4445,23 +4393,11 @@ class TextAnalyticsClient {
4445
4393
  realInputs = documents;
4446
4394
  realOptions = languageOrOptions || {};
4447
4395
  }
4448
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-analyzeSentiment", makeGeneratedAnalyzeSentimentOptions(realOptions));
4449
- try {
4450
- const result = await this.client.sentiment({
4451
- documents: realInputs
4452
- }, finalOptions);
4453
- return makeAnalyzeSentimentResultArray(realInputs, result);
4454
- }
4455
- catch (e) {
4456
- span.setStatus({
4457
- code: coreTracing.SpanStatusCode.ERROR,
4458
- message: e.message
4459
- });
4460
- throw e;
4461
- }
4462
- finally {
4463
- span.end();
4464
- }
4396
+ return this._tracing.withSpan("TextAnalyticsClient-analyzeSentiment", makeGeneratedAnalyzeSentimentOptions(realOptions), (finalOptions) => this.client
4397
+ .sentiment({
4398
+ documents: realInputs,
4399
+ }, finalOptions)
4400
+ .then((result) => makeAnalyzeSentimentResultArray(realInputs, result)));
4465
4401
  }
4466
4402
  async extractKeyPhrases(documents, languageOrOptions, options) {
4467
4403
  let realOptions;
@@ -4478,23 +4414,11 @@ class TextAnalyticsClient {
4478
4414
  realInputs = documents;
4479
4415
  realOptions = languageOrOptions || {};
4480
4416
  }
4481
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-extractKeyPhrases", makeGeneratedExtractKeyPhrasesOptions(realOptions));
4482
- try {
4483
- const result = await this.client.keyPhrases({
4484
- documents: realInputs
4485
- }, finalOptions);
4486
- return makeExtractKeyPhrasesResultArray(realInputs, result);
4487
- }
4488
- catch (e) {
4489
- span.setStatus({
4490
- code: coreTracing.SpanStatusCode.ERROR,
4491
- message: e.message
4492
- });
4493
- throw e;
4494
- }
4495
- finally {
4496
- span.end();
4497
- }
4417
+ return this._tracing.withSpan("TextAnalyticsClient-extractKeyPhrases", makeGeneratedExtractKeyPhrasesOptions(realOptions), (finalOptions) => this.client
4418
+ .keyPhrases({
4419
+ documents: realInputs,
4420
+ }, finalOptions)
4421
+ .then((result) => makeExtractKeyPhrasesResultArray(realInputs, result)));
4498
4422
  }
4499
4423
  async recognizePiiEntities(inputs, languageOrOptions, options) {
4500
4424
  let realOptions;
@@ -4508,23 +4432,11 @@ class TextAnalyticsClient {
4508
4432
  realInputs = inputs;
4509
4433
  realOptions = languageOrOptions || {};
4510
4434
  }
4511
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizePiiEntities", makeGeneratedRecognizePiiEntitiesOptions(realOptions));
4512
- try {
4513
- const result = await this.client.entitiesRecognitionPii({
4514
- documents: realInputs
4515
- }, finalOptions);
4516
- return makeRecognizePiiEntitiesResultArray(realInputs, result);
4517
- }
4518
- catch (e) {
4519
- span.setStatus({
4520
- code: coreTracing.SpanStatusCode.ERROR,
4521
- message: e.message
4522
- });
4523
- throw e;
4524
- }
4525
- finally {
4526
- span.end();
4527
- }
4435
+ return this._tracing.withSpan("TextAnalyticsClient-recognizePiiEntities", makeGeneratedRecognizePiiEntitiesOptions(realOptions), (finalOptions) => this.client
4436
+ .entitiesRecognitionPii({
4437
+ documents: realInputs,
4438
+ }, finalOptions)
4439
+ .then((result) => makeRecognizePiiEntitiesResultArray(realInputs, result)));
4528
4440
  }
4529
4441
  async recognizeLinkedEntities(documents, languageOrOptions, options) {
4530
4442
  let realOptions;
@@ -4541,23 +4453,11 @@ class TextAnalyticsClient {
4541
4453
  realInputs = documents;
4542
4454
  realOptions = languageOrOptions || {};
4543
4455
  }
4544
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizeLinkedEntities", makeGeneratedRecognizeLinkingEntitiesOptions(realOptions));
4545
- try {
4546
- const result = await this.client.entitiesLinking({
4547
- documents: realInputs
4548
- }, finalOptions);
4549
- return makeRecognizeLinkedEntitiesResultArray(realInputs, result);
4550
- }
4551
- catch (e) {
4552
- span.setStatus({
4553
- code: coreTracing.SpanStatusCode.ERROR,
4554
- message: e.message
4555
- });
4556
- throw e;
4557
- }
4558
- finally {
4559
- span.end();
4560
- }
4456
+ return this._tracing.withSpan("TextAnalyticsClient-recognizeLinkedEntities", makeGeneratedRecognizeLinkingEntitiesOptions(realOptions), (finalOptions) => this.client
4457
+ .entitiesLinking({
4458
+ documents: realInputs,
4459
+ }, finalOptions)
4460
+ .then((result) => makeRecognizeLinkedEntitiesResultArray(realInputs, result)));
4561
4461
  }
4562
4462
  async beginAnalyzeHealthcareEntities(documents, languageOrOptions, options) {
4563
4463
  let realOptions;
@@ -4574,10 +4474,11 @@ class TextAnalyticsClient {
4574
4474
  const { updateIntervalInMs, resumeFrom } = realOptions, restOptions = tslib.__rest(realOptions, ["updateIntervalInMs", "resumeFrom"]);
4575
4475
  const poller = new BeginAnalyzeHealthcarePoller({
4576
4476
  client: this.client,
4477
+ tracing: this._tracing,
4577
4478
  documents: realInputs,
4578
4479
  options: restOptions,
4579
4480
  updateIntervalInMs: updateIntervalInMs,
4580
- resumeFrom: resumeFrom
4481
+ resumeFrom: resumeFrom,
4581
4482
  });
4582
4483
  await poller.poll();
4583
4484
  return poller;
@@ -4597,34 +4498,21 @@ class TextAnalyticsClient {
4597
4498
  realInputs = documents;
4598
4499
  realOptions = languageOrOptions || {};
4599
4500
  }
4600
- validateActions(actions);
4601
4501
  const compiledActions = compileAnalyzeInput(actions);
4602
4502
  const { updateIntervalInMs, resumeFrom } = realOptions, restOptions = tslib.__rest(realOptions, ["updateIntervalInMs", "resumeFrom"]);
4603
4503
  const poller = new BeginAnalyzeActionsPoller({
4604
4504
  client: this.client,
4505
+ tracing: this._tracing,
4605
4506
  documents: realInputs,
4606
4507
  actions: compiledActions,
4607
4508
  options: restOptions,
4608
4509
  resumeFrom: resumeFrom,
4609
- updateIntervalInMs: updateIntervalInMs
4510
+ updateIntervalInMs: updateIntervalInMs,
4610
4511
  });
4611
4512
  await poller.poll();
4612
4513
  return poller;
4613
4514
  }
4614
4515
  }
4615
- function validateActions(actions) {
4616
- function validateActionType(actionList, actionType) {
4617
- var _a;
4618
- if (((_a = actionList === null || actionList === void 0 ? void 0 : actionList.length) !== null && _a !== void 0 ? _a : 0) > 1) {
4619
- throw new Error(`beginAnalyzeActions: Currently, the service can accept up to one action only for ${actionType} actions.`);
4620
- }
4621
- }
4622
- validateActionType(actions.analyzeSentimentActions, `analyzeSentiment`);
4623
- validateActionType(actions.extractKeyPhrasesActions, `extractKeyPhrases`);
4624
- validateActionType(actions.recognizeEntitiesActions, `recognizeEntities`);
4625
- validateActionType(actions.recognizeLinkedEntitiesActions, `recognizeLinkedEntities`);
4626
- validateActionType(actions.recognizePiiEntitiesActions, `recognizePiiEntities`);
4627
- }
4628
4516
  /**
4629
4517
  * @internal
4630
4518
  */
@@ -4635,7 +4523,7 @@ function compileAnalyzeInput(actions) {
4635
4523
  entityRecognitionTasks: (_b = actions.recognizeEntitiesActions) === null || _b === void 0 ? void 0 : _b.map(compose(setStrEncodingParam, addParamsToTask)),
4636
4524
  keyPhraseExtractionTasks: (_c = actions.extractKeyPhrasesActions) === null || _c === void 0 ? void 0 : _c.map(addParamsToTask),
4637
4525
  entityLinkingTasks: (_d = actions.recognizeLinkedEntitiesActions) === null || _d === void 0 ? void 0 : _d.map(compose(setStrEncodingParam, addParamsToTask)),
4638
- sentimentAnalysisTasks: (_e = actions.analyzeSentimentActions) === null || _e === void 0 ? void 0 : _e.map(compose(setStrEncodingParam, compose(setOpinionMining, addParamsToTask)))
4526
+ sentimentAnalysisTasks: (_e = actions.analyzeSentimentActions) === null || _e === void 0 ? void 0 : _e.map(compose(setStrEncodingParam, compose(setOpinionMining, addParamsToTask))),
4639
4527
  };
4640
4528
  }
4641
4529
  function isStringArray(documents) {
@@ -4652,7 +4540,7 @@ function convertToDetectLanguageInput(inputs, countryHint) {
4652
4540
  return {
4653
4541
  id: String(index),
4654
4542
  countryHint,
4655
- text
4543
+ text,
4656
4544
  };
4657
4545
  });
4658
4546
  }
@@ -4664,7 +4552,7 @@ function convertToTextDocumentInput(inputs, language) {
4664
4552
  return {
4665
4553
  id: String(index),
4666
4554
  language,
4667
- text
4555
+ text,
4668
4556
  };
4669
4557
  });
4670
4558
  }
@@ -4684,7 +4572,7 @@ function makeGeneratedAnalyzeSentimentOptions(params) {
4684
4572
  tracingOptions: params.tracingOptions,
4685
4573
  onResponse: params.onResponse,
4686
4574
  serializerOptions: params.serializerOptions,
4687
- loggingOptOut: params.disableServiceLogs
4575
+ loggingOptOut: params.disableServiceLogs,
4688
4576
  };
4689
4577
  }
4690
4578
  /**
@@ -4704,7 +4592,7 @@ function makeGeneratedRecognizePiiEntitiesOptions(params) {
4704
4592
  piiCategories: params.categoriesFilter,
4705
4593
  onResponse: params.onResponse,
4706
4594
  serializerOptions: params.serializerOptions,
4707
- loggingOptOut: params.disableServiceLogs
4595
+ loggingOptOut: params.disableServiceLogs,
4708
4596
  };
4709
4597
  }
4710
4598
  /**
@@ -4722,7 +4610,7 @@ function makeGeneratedRecognizeCategorizedEntitiesOptions(params) {
4722
4610
  tracingOptions: params.tracingOptions,
4723
4611
  onResponse: params.onResponse,
4724
4612
  serializerOptions: params.serializerOptions,
4725
- loggingOptOut: params.disableServiceLogs
4613
+ loggingOptOut: params.disableServiceLogs,
4726
4614
  };
4727
4615
  }
4728
4616
  /**
@@ -4739,7 +4627,7 @@ function makeGeneratedDetectLanguageOptions(params) {
4739
4627
  tracingOptions: params.tracingOptions,
4740
4628
  onResponse: params.onResponse,
4741
4629
  serializerOptions: params.serializerOptions,
4742
- loggingOptOut: params.disableServiceLogs
4630
+ loggingOptOut: params.disableServiceLogs,
4743
4631
  };
4744
4632
  }
4745
4633
  /**
@@ -4756,7 +4644,7 @@ function makeGeneratedExtractKeyPhrasesOptions(params) {
4756
4644
  tracingOptions: params.tracingOptions,
4757
4645
  onResponse: params.onResponse,
4758
4646
  serializerOptions: params.serializerOptions,
4759
- loggingOptOut: params.disableServiceLogs
4647
+ loggingOptOut: params.disableServiceLogs,
4760
4648
  };
4761
4649
  }
4762
4650
  /**
@@ -4774,15 +4662,535 @@ function makeGeneratedRecognizeLinkingEntitiesOptions(params) {
4774
4662
  onResponse: params.onResponse,
4775
4663
  serializerOptions: params.serializerOptions,
4776
4664
  loggingOptOut: params.disableServiceLogs,
4777
- stringIndexType: setStrEncodingParamValue(params.stringIndexType)
4665
+ stringIndexType: setStrEncodingParamValue(params.stringIndexType),
4778
4666
  };
4779
4667
  }
4780
4668
 
4669
+ /*
4670
+ * Copyright (c) Microsoft Corporation.
4671
+ * Licensed under the MIT License.
4672
+ *
4673
+ * Code generated by Microsoft (R) AutoRest Code Generator.
4674
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
4675
+ */
4676
+ /** Known values of {@link StringIndexType} that the service accepts. */
4677
+ var KnownStringIndexType;
4678
+ (function (KnownStringIndexType) {
4679
+ /** Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo. */
4680
+ KnownStringIndexType["TextElementV8"] = "TextElement_v8";
4681
+ /** Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python. */
4682
+ KnownStringIndexType["UnicodeCodePoint"] = "UnicodeCodePoint";
4683
+ /** Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript. */
4684
+ KnownStringIndexType["Utf16CodeUnit"] = "Utf16CodeUnit";
4685
+ })(KnownStringIndexType || (KnownStringIndexType = {}));
4686
+ /** Known values of {@link PiiTaskParametersDomain} that the service accepts. */
4687
+ var KnownPiiTaskParametersDomain;
4688
+ (function (KnownPiiTaskParametersDomain) {
4689
+ /** Phi */
4690
+ KnownPiiTaskParametersDomain["Phi"] = "phi";
4691
+ /** None */
4692
+ KnownPiiTaskParametersDomain["None"] = "none";
4693
+ })(KnownPiiTaskParametersDomain || (KnownPiiTaskParametersDomain = {}));
4694
+ /** Known values of {@link PiiCategory} that the service accepts. */
4695
+ var KnownPiiCategory;
4696
+ (function (KnownPiiCategory) {
4697
+ /** ABARoutingNumber */
4698
+ KnownPiiCategory["ABARoutingNumber"] = "ABARoutingNumber";
4699
+ /** ARNationalIdentityNumber */
4700
+ KnownPiiCategory["ARNationalIdentityNumber"] = "ARNationalIdentityNumber";
4701
+ /** AUBankAccountNumber */
4702
+ KnownPiiCategory["AUBankAccountNumber"] = "AUBankAccountNumber";
4703
+ /** AUDriversLicenseNumber */
4704
+ KnownPiiCategory["AUDriversLicenseNumber"] = "AUDriversLicenseNumber";
4705
+ /** AUMedicalAccountNumber */
4706
+ KnownPiiCategory["AUMedicalAccountNumber"] = "AUMedicalAccountNumber";
4707
+ /** AUPassportNumber */
4708
+ KnownPiiCategory["AUPassportNumber"] = "AUPassportNumber";
4709
+ /** AUTaxFileNumber */
4710
+ KnownPiiCategory["AUTaxFileNumber"] = "AUTaxFileNumber";
4711
+ /** AUBusinessNumber */
4712
+ KnownPiiCategory["AUBusinessNumber"] = "AUBusinessNumber";
4713
+ /** AUCompanyNumber */
4714
+ KnownPiiCategory["AUCompanyNumber"] = "AUCompanyNumber";
4715
+ /** ATIdentityCard */
4716
+ KnownPiiCategory["ATIdentityCard"] = "ATIdentityCard";
4717
+ /** ATTaxIdentificationNumber */
4718
+ KnownPiiCategory["ATTaxIdentificationNumber"] = "ATTaxIdentificationNumber";
4719
+ /** ATValueAddedTaxNumber */
4720
+ KnownPiiCategory["ATValueAddedTaxNumber"] = "ATValueAddedTaxNumber";
4721
+ /** AzureDocumentDBAuthKey */
4722
+ KnownPiiCategory["AzureDocumentDBAuthKey"] = "AzureDocumentDBAuthKey";
4723
+ /** AzureIaasDatabaseConnectionAndSQLString */
4724
+ KnownPiiCategory["AzureIaasDatabaseConnectionAndSQLString"] = "AzureIAASDatabaseConnectionAndSQLString";
4725
+ /** AzureIoTConnectionString */
4726
+ KnownPiiCategory["AzureIoTConnectionString"] = "AzureIoTConnectionString";
4727
+ /** AzurePublishSettingPassword */
4728
+ KnownPiiCategory["AzurePublishSettingPassword"] = "AzurePublishSettingPassword";
4729
+ /** AzureRedisCacheString */
4730
+ KnownPiiCategory["AzureRedisCacheString"] = "AzureRedisCacheString";
4731
+ /** AzureSAS */
4732
+ KnownPiiCategory["AzureSAS"] = "AzureSAS";
4733
+ /** AzureServiceBusString */
4734
+ KnownPiiCategory["AzureServiceBusString"] = "AzureServiceBusString";
4735
+ /** AzureStorageAccountKey */
4736
+ KnownPiiCategory["AzureStorageAccountKey"] = "AzureStorageAccountKey";
4737
+ /** AzureStorageAccountGeneric */
4738
+ KnownPiiCategory["AzureStorageAccountGeneric"] = "AzureStorageAccountGeneric";
4739
+ /** BENationalNumber */
4740
+ KnownPiiCategory["BENationalNumber"] = "BENationalNumber";
4741
+ /** BENationalNumberV2 */
4742
+ KnownPiiCategory["BENationalNumberV2"] = "BENationalNumberV2";
4743
+ /** BEValueAddedTaxNumber */
4744
+ KnownPiiCategory["BEValueAddedTaxNumber"] = "BEValueAddedTaxNumber";
4745
+ /** BrcpfNumber */
4746
+ KnownPiiCategory["BrcpfNumber"] = "BRCPFNumber";
4747
+ /** BRLegalEntityNumber */
4748
+ KnownPiiCategory["BRLegalEntityNumber"] = "BRLegalEntityNumber";
4749
+ /** BRNationalIdrg */
4750
+ KnownPiiCategory["BRNationalIdrg"] = "BRNationalIDRG";
4751
+ /** BGUniformCivilNumber */
4752
+ KnownPiiCategory["BGUniformCivilNumber"] = "BGUniformCivilNumber";
4753
+ /** CABankAccountNumber */
4754
+ KnownPiiCategory["CABankAccountNumber"] = "CABankAccountNumber";
4755
+ /** CADriversLicenseNumber */
4756
+ KnownPiiCategory["CADriversLicenseNumber"] = "CADriversLicenseNumber";
4757
+ /** CAHealthServiceNumber */
4758
+ KnownPiiCategory["CAHealthServiceNumber"] = "CAHealthServiceNumber";
4759
+ /** CAPassportNumber */
4760
+ KnownPiiCategory["CAPassportNumber"] = "CAPassportNumber";
4761
+ /** CAPersonalHealthIdentification */
4762
+ KnownPiiCategory["CAPersonalHealthIdentification"] = "CAPersonalHealthIdentification";
4763
+ /** CASocialInsuranceNumber */
4764
+ KnownPiiCategory["CASocialInsuranceNumber"] = "CASocialInsuranceNumber";
4765
+ /** CLIdentityCardNumber */
4766
+ KnownPiiCategory["CLIdentityCardNumber"] = "CLIdentityCardNumber";
4767
+ /** CNResidentIdentityCardNumber */
4768
+ KnownPiiCategory["CNResidentIdentityCardNumber"] = "CNResidentIdentityCardNumber";
4769
+ /** CreditCardNumber */
4770
+ KnownPiiCategory["CreditCardNumber"] = "CreditCardNumber";
4771
+ /** HRIdentityCardNumber */
4772
+ KnownPiiCategory["HRIdentityCardNumber"] = "HRIdentityCardNumber";
4773
+ /** HRNationalIDNumber */
4774
+ KnownPiiCategory["HRNationalIDNumber"] = "HRNationalIDNumber";
4775
+ /** HRPersonalIdentificationNumber */
4776
+ KnownPiiCategory["HRPersonalIdentificationNumber"] = "HRPersonalIdentificationNumber";
4777
+ /** HRPersonalIdentificationOIBNumberV2 */
4778
+ KnownPiiCategory["HRPersonalIdentificationOIBNumberV2"] = "HRPersonalIdentificationOIBNumberV2";
4779
+ /** CYIdentityCard */
4780
+ KnownPiiCategory["CYIdentityCard"] = "CYIdentityCard";
4781
+ /** CYTaxIdentificationNumber */
4782
+ KnownPiiCategory["CYTaxIdentificationNumber"] = "CYTaxIdentificationNumber";
4783
+ /** CZPersonalIdentityNumber */
4784
+ KnownPiiCategory["CZPersonalIdentityNumber"] = "CZPersonalIdentityNumber";
4785
+ /** CZPersonalIdentityV2 */
4786
+ KnownPiiCategory["CZPersonalIdentityV2"] = "CZPersonalIdentityV2";
4787
+ /** DKPersonalIdentificationNumber */
4788
+ KnownPiiCategory["DKPersonalIdentificationNumber"] = "DKPersonalIdentificationNumber";
4789
+ /** DKPersonalIdentificationV2 */
4790
+ KnownPiiCategory["DKPersonalIdentificationV2"] = "DKPersonalIdentificationV2";
4791
+ /** DrugEnforcementAgencyNumber */
4792
+ KnownPiiCategory["DrugEnforcementAgencyNumber"] = "DrugEnforcementAgencyNumber";
4793
+ /** EEPersonalIdentificationCode */
4794
+ KnownPiiCategory["EEPersonalIdentificationCode"] = "EEPersonalIdentificationCode";
4795
+ /** EUDebitCardNumber */
4796
+ KnownPiiCategory["EUDebitCardNumber"] = "EUDebitCardNumber";
4797
+ /** EUDriversLicenseNumber */
4798
+ KnownPiiCategory["EUDriversLicenseNumber"] = "EUDriversLicenseNumber";
4799
+ /** EugpsCoordinates */
4800
+ KnownPiiCategory["EugpsCoordinates"] = "EUGPSCoordinates";
4801
+ /** EUNationalIdentificationNumber */
4802
+ KnownPiiCategory["EUNationalIdentificationNumber"] = "EUNationalIdentificationNumber";
4803
+ /** EUPassportNumber */
4804
+ KnownPiiCategory["EUPassportNumber"] = "EUPassportNumber";
4805
+ /** EUSocialSecurityNumber */
4806
+ KnownPiiCategory["EUSocialSecurityNumber"] = "EUSocialSecurityNumber";
4807
+ /** EUTaxIdentificationNumber */
4808
+ KnownPiiCategory["EUTaxIdentificationNumber"] = "EUTaxIdentificationNumber";
4809
+ /** FIEuropeanHealthNumber */
4810
+ KnownPiiCategory["FIEuropeanHealthNumber"] = "FIEuropeanHealthNumber";
4811
+ /** FINationalID */
4812
+ KnownPiiCategory["FINationalID"] = "FINationalID";
4813
+ /** FINationalIDV2 */
4814
+ KnownPiiCategory["FINationalIDV2"] = "FINationalIDV2";
4815
+ /** FIPassportNumber */
4816
+ KnownPiiCategory["FIPassportNumber"] = "FIPassportNumber";
4817
+ /** FRDriversLicenseNumber */
4818
+ KnownPiiCategory["FRDriversLicenseNumber"] = "FRDriversLicenseNumber";
4819
+ /** FRHealthInsuranceNumber */
4820
+ KnownPiiCategory["FRHealthInsuranceNumber"] = "FRHealthInsuranceNumber";
4821
+ /** FRNationalID */
4822
+ KnownPiiCategory["FRNationalID"] = "FRNationalID";
4823
+ /** FRPassportNumber */
4824
+ KnownPiiCategory["FRPassportNumber"] = "FRPassportNumber";
4825
+ /** FRSocialSecurityNumber */
4826
+ KnownPiiCategory["FRSocialSecurityNumber"] = "FRSocialSecurityNumber";
4827
+ /** FRTaxIdentificationNumber */
4828
+ KnownPiiCategory["FRTaxIdentificationNumber"] = "FRTaxIdentificationNumber";
4829
+ /** FRValueAddedTaxNumber */
4830
+ KnownPiiCategory["FRValueAddedTaxNumber"] = "FRValueAddedTaxNumber";
4831
+ /** DEDriversLicenseNumber */
4832
+ KnownPiiCategory["DEDriversLicenseNumber"] = "DEDriversLicenseNumber";
4833
+ /** DEPassportNumber */
4834
+ KnownPiiCategory["DEPassportNumber"] = "DEPassportNumber";
4835
+ /** DEIdentityCardNumber */
4836
+ KnownPiiCategory["DEIdentityCardNumber"] = "DEIdentityCardNumber";
4837
+ /** DETaxIdentificationNumber */
4838
+ KnownPiiCategory["DETaxIdentificationNumber"] = "DETaxIdentificationNumber";
4839
+ /** DEValueAddedNumber */
4840
+ KnownPiiCategory["DEValueAddedNumber"] = "DEValueAddedNumber";
4841
+ /** GRNationalIDCard */
4842
+ KnownPiiCategory["GRNationalIDCard"] = "GRNationalIDCard";
4843
+ /** GRNationalIDV2 */
4844
+ KnownPiiCategory["GRNationalIDV2"] = "GRNationalIDV2";
4845
+ /** GRTaxIdentificationNumber */
4846
+ KnownPiiCategory["GRTaxIdentificationNumber"] = "GRTaxIdentificationNumber";
4847
+ /** HKIdentityCardNumber */
4848
+ KnownPiiCategory["HKIdentityCardNumber"] = "HKIdentityCardNumber";
4849
+ /** HUValueAddedNumber */
4850
+ KnownPiiCategory["HUValueAddedNumber"] = "HUValueAddedNumber";
4851
+ /** HUPersonalIdentificationNumber */
4852
+ KnownPiiCategory["HUPersonalIdentificationNumber"] = "HUPersonalIdentificationNumber";
4853
+ /** HUTaxIdentificationNumber */
4854
+ KnownPiiCategory["HUTaxIdentificationNumber"] = "HUTaxIdentificationNumber";
4855
+ /** INPermanentAccount */
4856
+ KnownPiiCategory["INPermanentAccount"] = "INPermanentAccount";
4857
+ /** INUniqueIdentificationNumber */
4858
+ KnownPiiCategory["INUniqueIdentificationNumber"] = "INUniqueIdentificationNumber";
4859
+ /** IDIdentityCardNumber */
4860
+ KnownPiiCategory["IDIdentityCardNumber"] = "IDIdentityCardNumber";
4861
+ /** InternationalBankingAccountNumber */
4862
+ KnownPiiCategory["InternationalBankingAccountNumber"] = "InternationalBankingAccountNumber";
4863
+ /** IEPersonalPublicServiceNumber */
4864
+ KnownPiiCategory["IEPersonalPublicServiceNumber"] = "IEPersonalPublicServiceNumber";
4865
+ /** IEPersonalPublicServiceNumberV2 */
4866
+ KnownPiiCategory["IEPersonalPublicServiceNumberV2"] = "IEPersonalPublicServiceNumberV2";
4867
+ /** ILBankAccountNumber */
4868
+ KnownPiiCategory["ILBankAccountNumber"] = "ILBankAccountNumber";
4869
+ /** ILNationalID */
4870
+ KnownPiiCategory["ILNationalID"] = "ILNationalID";
4871
+ /** ITDriversLicenseNumber */
4872
+ KnownPiiCategory["ITDriversLicenseNumber"] = "ITDriversLicenseNumber";
4873
+ /** ITFiscalCode */
4874
+ KnownPiiCategory["ITFiscalCode"] = "ITFiscalCode";
4875
+ /** ITValueAddedTaxNumber */
4876
+ KnownPiiCategory["ITValueAddedTaxNumber"] = "ITValueAddedTaxNumber";
4877
+ /** JPBankAccountNumber */
4878
+ KnownPiiCategory["JPBankAccountNumber"] = "JPBankAccountNumber";
4879
+ /** JPDriversLicenseNumber */
4880
+ KnownPiiCategory["JPDriversLicenseNumber"] = "JPDriversLicenseNumber";
4881
+ /** JPPassportNumber */
4882
+ KnownPiiCategory["JPPassportNumber"] = "JPPassportNumber";
4883
+ /** JPResidentRegistrationNumber */
4884
+ KnownPiiCategory["JPResidentRegistrationNumber"] = "JPResidentRegistrationNumber";
4885
+ /** JPSocialInsuranceNumber */
4886
+ KnownPiiCategory["JPSocialInsuranceNumber"] = "JPSocialInsuranceNumber";
4887
+ /** JPMyNumberCorporate */
4888
+ KnownPiiCategory["JPMyNumberCorporate"] = "JPMyNumberCorporate";
4889
+ /** JPMyNumberPersonal */
4890
+ KnownPiiCategory["JPMyNumberPersonal"] = "JPMyNumberPersonal";
4891
+ /** JPResidenceCardNumber */
4892
+ KnownPiiCategory["JPResidenceCardNumber"] = "JPResidenceCardNumber";
4893
+ /** LVPersonalCode */
4894
+ KnownPiiCategory["LVPersonalCode"] = "LVPersonalCode";
4895
+ /** LTPersonalCode */
4896
+ KnownPiiCategory["LTPersonalCode"] = "LTPersonalCode";
4897
+ /** LUNationalIdentificationNumberNatural */
4898
+ KnownPiiCategory["LUNationalIdentificationNumberNatural"] = "LUNationalIdentificationNumberNatural";
4899
+ /** LUNationalIdentificationNumberNonNatural */
4900
+ KnownPiiCategory["LUNationalIdentificationNumberNonNatural"] = "LUNationalIdentificationNumberNonNatural";
4901
+ /** MYIdentityCardNumber */
4902
+ KnownPiiCategory["MYIdentityCardNumber"] = "MYIdentityCardNumber";
4903
+ /** MTIdentityCardNumber */
4904
+ KnownPiiCategory["MTIdentityCardNumber"] = "MTIdentityCardNumber";
4905
+ /** MTTaxIDNumber */
4906
+ KnownPiiCategory["MTTaxIDNumber"] = "MTTaxIDNumber";
4907
+ /** NLCitizensServiceNumber */
4908
+ KnownPiiCategory["NLCitizensServiceNumber"] = "NLCitizensServiceNumber";
4909
+ /** NLCitizensServiceNumberV2 */
4910
+ KnownPiiCategory["NLCitizensServiceNumberV2"] = "NLCitizensServiceNumberV2";
4911
+ /** NLTaxIdentificationNumber */
4912
+ KnownPiiCategory["NLTaxIdentificationNumber"] = "NLTaxIdentificationNumber";
4913
+ /** NLValueAddedTaxNumber */
4914
+ KnownPiiCategory["NLValueAddedTaxNumber"] = "NLValueAddedTaxNumber";
4915
+ /** NZBankAccountNumber */
4916
+ KnownPiiCategory["NZBankAccountNumber"] = "NZBankAccountNumber";
4917
+ /** NZDriversLicenseNumber */
4918
+ KnownPiiCategory["NZDriversLicenseNumber"] = "NZDriversLicenseNumber";
4919
+ /** NZInlandRevenueNumber */
4920
+ KnownPiiCategory["NZInlandRevenueNumber"] = "NZInlandRevenueNumber";
4921
+ /** NZMinistryOfHealthNumber */
4922
+ KnownPiiCategory["NZMinistryOfHealthNumber"] = "NZMinistryOfHealthNumber";
4923
+ /** NZSocialWelfareNumber */
4924
+ KnownPiiCategory["NZSocialWelfareNumber"] = "NZSocialWelfareNumber";
4925
+ /** NOIdentityNumber */
4926
+ KnownPiiCategory["NOIdentityNumber"] = "NOIdentityNumber";
4927
+ /** PHUnifiedMultiPurposeIDNumber */
4928
+ KnownPiiCategory["PHUnifiedMultiPurposeIDNumber"] = "PHUnifiedMultiPurposeIDNumber";
4929
+ /** PLIdentityCard */
4930
+ KnownPiiCategory["PLIdentityCard"] = "PLIdentityCard";
4931
+ /** PLNationalID */
4932
+ KnownPiiCategory["PLNationalID"] = "PLNationalID";
4933
+ /** PLNationalIDV2 */
4934
+ KnownPiiCategory["PLNationalIDV2"] = "PLNationalIDV2";
4935
+ /** PLPassportNumber */
4936
+ KnownPiiCategory["PLPassportNumber"] = "PLPassportNumber";
4937
+ /** PLTaxIdentificationNumber */
4938
+ KnownPiiCategory["PLTaxIdentificationNumber"] = "PLTaxIdentificationNumber";
4939
+ /** PlregonNumber */
4940
+ KnownPiiCategory["PlregonNumber"] = "PLREGONNumber";
4941
+ /** PTCitizenCardNumber */
4942
+ KnownPiiCategory["PTCitizenCardNumber"] = "PTCitizenCardNumber";
4943
+ /** PTCitizenCardNumberV2 */
4944
+ KnownPiiCategory["PTCitizenCardNumberV2"] = "PTCitizenCardNumberV2";
4945
+ /** PTTaxIdentificationNumber */
4946
+ KnownPiiCategory["PTTaxIdentificationNumber"] = "PTTaxIdentificationNumber";
4947
+ /** ROPersonalNumericalCode */
4948
+ KnownPiiCategory["ROPersonalNumericalCode"] = "ROPersonalNumericalCode";
4949
+ /** RUPassportNumberDomestic */
4950
+ KnownPiiCategory["RUPassportNumberDomestic"] = "RUPassportNumberDomestic";
4951
+ /** RUPassportNumberInternational */
4952
+ KnownPiiCategory["RUPassportNumberInternational"] = "RUPassportNumberInternational";
4953
+ /** SANationalID */
4954
+ KnownPiiCategory["SANationalID"] = "SANationalID";
4955
+ /** SGNationalRegistrationIdentityCardNumber */
4956
+ KnownPiiCategory["SGNationalRegistrationIdentityCardNumber"] = "SGNationalRegistrationIdentityCardNumber";
4957
+ /** SKPersonalNumber */
4958
+ KnownPiiCategory["SKPersonalNumber"] = "SKPersonalNumber";
4959
+ /** SITaxIdentificationNumber */
4960
+ KnownPiiCategory["SITaxIdentificationNumber"] = "SITaxIdentificationNumber";
4961
+ /** SIUniqueMasterCitizenNumber */
4962
+ KnownPiiCategory["SIUniqueMasterCitizenNumber"] = "SIUniqueMasterCitizenNumber";
4963
+ /** ZAIdentificationNumber */
4964
+ KnownPiiCategory["ZAIdentificationNumber"] = "ZAIdentificationNumber";
4965
+ /** KRResidentRegistrationNumber */
4966
+ KnownPiiCategory["KRResidentRegistrationNumber"] = "KRResidentRegistrationNumber";
4967
+ /** Esdni */
4968
+ KnownPiiCategory["Esdni"] = "ESDNI";
4969
+ /** ESSocialSecurityNumber */
4970
+ KnownPiiCategory["ESSocialSecurityNumber"] = "ESSocialSecurityNumber";
4971
+ /** ESTaxIdentificationNumber */
4972
+ KnownPiiCategory["ESTaxIdentificationNumber"] = "ESTaxIdentificationNumber";
4973
+ /** SQLServerConnectionString */
4974
+ KnownPiiCategory["SQLServerConnectionString"] = "SQLServerConnectionString";
4975
+ /** SENationalID */
4976
+ KnownPiiCategory["SENationalID"] = "SENationalID";
4977
+ /** SENationalIDV2 */
4978
+ KnownPiiCategory["SENationalIDV2"] = "SENationalIDV2";
4979
+ /** SEPassportNumber */
4980
+ KnownPiiCategory["SEPassportNumber"] = "SEPassportNumber";
4981
+ /** SETaxIdentificationNumber */
4982
+ KnownPiiCategory["SETaxIdentificationNumber"] = "SETaxIdentificationNumber";
4983
+ /** SwiftCode */
4984
+ KnownPiiCategory["SwiftCode"] = "SWIFTCode";
4985
+ /** CHSocialSecurityNumber */
4986
+ KnownPiiCategory["CHSocialSecurityNumber"] = "CHSocialSecurityNumber";
4987
+ /** TWNationalID */
4988
+ KnownPiiCategory["TWNationalID"] = "TWNationalID";
4989
+ /** TWPassportNumber */
4990
+ KnownPiiCategory["TWPassportNumber"] = "TWPassportNumber";
4991
+ /** TWResidentCertificate */
4992
+ KnownPiiCategory["TWResidentCertificate"] = "TWResidentCertificate";
4993
+ /** THPopulationIdentificationCode */
4994
+ KnownPiiCategory["THPopulationIdentificationCode"] = "THPopulationIdentificationCode";
4995
+ /** TRNationalIdentificationNumber */
4996
+ KnownPiiCategory["TRNationalIdentificationNumber"] = "TRNationalIdentificationNumber";
4997
+ /** UKDriversLicenseNumber */
4998
+ KnownPiiCategory["UKDriversLicenseNumber"] = "UKDriversLicenseNumber";
4999
+ /** UKElectoralRollNumber */
5000
+ KnownPiiCategory["UKElectoralRollNumber"] = "UKElectoralRollNumber";
5001
+ /** UKNationalHealthNumber */
5002
+ KnownPiiCategory["UKNationalHealthNumber"] = "UKNationalHealthNumber";
5003
+ /** UKNationalInsuranceNumber */
5004
+ KnownPiiCategory["UKNationalInsuranceNumber"] = "UKNationalInsuranceNumber";
5005
+ /** UKUniqueTaxpayerNumber */
5006
+ KnownPiiCategory["UKUniqueTaxpayerNumber"] = "UKUniqueTaxpayerNumber";
5007
+ /** UsukPassportNumber */
5008
+ KnownPiiCategory["UsukPassportNumber"] = "USUKPassportNumber";
5009
+ /** USBankAccountNumber */
5010
+ KnownPiiCategory["USBankAccountNumber"] = "USBankAccountNumber";
5011
+ /** USDriversLicenseNumber */
5012
+ KnownPiiCategory["USDriversLicenseNumber"] = "USDriversLicenseNumber";
5013
+ /** USIndividualTaxpayerIdentification */
5014
+ KnownPiiCategory["USIndividualTaxpayerIdentification"] = "USIndividualTaxpayerIdentification";
5015
+ /** USSocialSecurityNumber */
5016
+ KnownPiiCategory["USSocialSecurityNumber"] = "USSocialSecurityNumber";
5017
+ /** UAPassportNumberDomestic */
5018
+ KnownPiiCategory["UAPassportNumberDomestic"] = "UAPassportNumberDomestic";
5019
+ /** UAPassportNumberInternational */
5020
+ KnownPiiCategory["UAPassportNumberInternational"] = "UAPassportNumberInternational";
5021
+ /** Organization */
5022
+ KnownPiiCategory["Organization"] = "Organization";
5023
+ /** Email */
5024
+ KnownPiiCategory["Email"] = "Email";
5025
+ /** URL */
5026
+ KnownPiiCategory["URL"] = "URL";
5027
+ /** Age */
5028
+ KnownPiiCategory["Age"] = "Age";
5029
+ /** PhoneNumber */
5030
+ KnownPiiCategory["PhoneNumber"] = "PhoneNumber";
5031
+ /** IPAddress */
5032
+ KnownPiiCategory["IPAddress"] = "IPAddress";
5033
+ /** Date */
5034
+ KnownPiiCategory["Date"] = "Date";
5035
+ /** Person */
5036
+ KnownPiiCategory["Person"] = "Person";
5037
+ /** Address */
5038
+ KnownPiiCategory["Address"] = "Address";
5039
+ /** All */
5040
+ KnownPiiCategory["All"] = "All";
5041
+ /** Default */
5042
+ KnownPiiCategory["Default"] = "Default";
5043
+ })(KnownPiiCategory || (KnownPiiCategory = {}));
5044
+ /** Known values of {@link ErrorCodeValue} that the service accepts. */
5045
+ var KnownErrorCodeValue;
5046
+ (function (KnownErrorCodeValue) {
5047
+ /** InvalidRequest */
5048
+ KnownErrorCodeValue["InvalidRequest"] = "InvalidRequest";
5049
+ /** InvalidArgument */
5050
+ KnownErrorCodeValue["InvalidArgument"] = "InvalidArgument";
5051
+ /** InternalServerError */
5052
+ KnownErrorCodeValue["InternalServerError"] = "InternalServerError";
5053
+ /** ServiceUnavailable */
5054
+ KnownErrorCodeValue["ServiceUnavailable"] = "ServiceUnavailable";
5055
+ /** NotFound */
5056
+ KnownErrorCodeValue["NotFound"] = "NotFound";
5057
+ })(KnownErrorCodeValue || (KnownErrorCodeValue = {}));
5058
+ /** Known values of {@link InnerErrorCodeValue} that the service accepts. */
5059
+ exports.KnownInnerErrorCodeValue = void 0;
5060
+ (function (KnownInnerErrorCodeValue) {
5061
+ /** InvalidParameterValue */
5062
+ KnownInnerErrorCodeValue["InvalidParameterValue"] = "InvalidParameterValue";
5063
+ /** InvalidRequestBodyFormat */
5064
+ KnownInnerErrorCodeValue["InvalidRequestBodyFormat"] = "InvalidRequestBodyFormat";
5065
+ /** EmptyRequest */
5066
+ KnownInnerErrorCodeValue["EmptyRequest"] = "EmptyRequest";
5067
+ /** MissingInputRecords */
5068
+ KnownInnerErrorCodeValue["MissingInputRecords"] = "MissingInputRecords";
5069
+ /** InvalidDocument */
5070
+ KnownInnerErrorCodeValue["InvalidDocument"] = "InvalidDocument";
5071
+ /** ModelVersionIncorrect */
5072
+ KnownInnerErrorCodeValue["ModelVersionIncorrect"] = "ModelVersionIncorrect";
5073
+ /** InvalidDocumentBatch */
5074
+ KnownInnerErrorCodeValue["InvalidDocumentBatch"] = "InvalidDocumentBatch";
5075
+ /** UnsupportedLanguageCode */
5076
+ KnownInnerErrorCodeValue["UnsupportedLanguageCode"] = "UnsupportedLanguageCode";
5077
+ /** InvalidCountryHint */
5078
+ KnownInnerErrorCodeValue["InvalidCountryHint"] = "InvalidCountryHint";
5079
+ })(exports.KnownInnerErrorCodeValue || (exports.KnownInnerErrorCodeValue = {}));
5080
+ /** Known values of {@link WarningCode} that the service accepts. */
5081
+ exports.KnownWarningCode = void 0;
5082
+ (function (KnownWarningCode) {
5083
+ /** LongWordsInDocument */
5084
+ KnownWarningCode["LongWordsInDocument"] = "LongWordsInDocument";
5085
+ /** DocumentTruncated */
5086
+ KnownWarningCode["DocumentTruncated"] = "DocumentTruncated";
5087
+ })(exports.KnownWarningCode || (exports.KnownWarningCode = {}));
5088
+ /** Known values of {@link HealthcareEntityCategory} that the service accepts. */
5089
+ exports.KnownHealthcareEntityCategory = void 0;
5090
+ (function (KnownHealthcareEntityCategory) {
5091
+ /** BodyStructure */
5092
+ KnownHealthcareEntityCategory["BodyStructure"] = "BODY_STRUCTURE";
5093
+ /** AGE */
5094
+ KnownHealthcareEntityCategory["AGE"] = "AGE";
5095
+ /** Gender */
5096
+ KnownHealthcareEntityCategory["Gender"] = "GENDER";
5097
+ /** ExaminationName */
5098
+ KnownHealthcareEntityCategory["ExaminationName"] = "EXAMINATION_NAME";
5099
+ /** Date */
5100
+ KnownHealthcareEntityCategory["Date"] = "DATE";
5101
+ /** Direction */
5102
+ KnownHealthcareEntityCategory["Direction"] = "DIRECTION";
5103
+ /** Frequency */
5104
+ KnownHealthcareEntityCategory["Frequency"] = "FREQUENCY";
5105
+ /** MeasurementValue */
5106
+ KnownHealthcareEntityCategory["MeasurementValue"] = "MEASUREMENT_VALUE";
5107
+ /** MeasurementUnit */
5108
+ KnownHealthcareEntityCategory["MeasurementUnit"] = "MEASUREMENT_UNIT";
5109
+ /** RelationalOperator */
5110
+ KnownHealthcareEntityCategory["RelationalOperator"] = "RELATIONAL_OPERATOR";
5111
+ /** Time */
5112
+ KnownHealthcareEntityCategory["Time"] = "TIME";
5113
+ /** GeneORProtein */
5114
+ KnownHealthcareEntityCategory["GeneORProtein"] = "GENE_OR_PROTEIN";
5115
+ /** Variant */
5116
+ KnownHealthcareEntityCategory["Variant"] = "VARIANT";
5117
+ /** AdministrativeEvent */
5118
+ KnownHealthcareEntityCategory["AdministrativeEvent"] = "ADMINISTRATIVE_EVENT";
5119
+ /** CareEnvironment */
5120
+ KnownHealthcareEntityCategory["CareEnvironment"] = "CARE_ENVIRONMENT";
5121
+ /** HealthcareProfession */
5122
+ KnownHealthcareEntityCategory["HealthcareProfession"] = "HEALTHCARE_PROFESSION";
5123
+ /** Diagnosis */
5124
+ KnownHealthcareEntityCategory["Diagnosis"] = "DIAGNOSIS";
5125
+ /** SymptomORSign */
5126
+ KnownHealthcareEntityCategory["SymptomORSign"] = "SYMPTOM_OR_SIGN";
5127
+ /** ConditionQualifier */
5128
+ KnownHealthcareEntityCategory["ConditionQualifier"] = "CONDITION_QUALIFIER";
5129
+ /** MedicationClass */
5130
+ KnownHealthcareEntityCategory["MedicationClass"] = "MEDICATION_CLASS";
5131
+ /** MedicationName */
5132
+ KnownHealthcareEntityCategory["MedicationName"] = "MEDICATION_NAME";
5133
+ /** Dosage */
5134
+ KnownHealthcareEntityCategory["Dosage"] = "DOSAGE";
5135
+ /** MedicationForm */
5136
+ KnownHealthcareEntityCategory["MedicationForm"] = "MEDICATION_FORM";
5137
+ /** MedicationRoute */
5138
+ KnownHealthcareEntityCategory["MedicationRoute"] = "MEDICATION_ROUTE";
5139
+ /** FamilyRelation */
5140
+ KnownHealthcareEntityCategory["FamilyRelation"] = "FAMILY_RELATION";
5141
+ /** TreatmentName */
5142
+ KnownHealthcareEntityCategory["TreatmentName"] = "TREATMENT_NAME";
5143
+ })(exports.KnownHealthcareEntityCategory || (exports.KnownHealthcareEntityCategory = {}));
5144
+ /** Known values of {@link RelationType} that the service accepts. */
5145
+ var KnownRelationType;
5146
+ (function (KnownRelationType) {
5147
+ /** Abbreviation */
5148
+ KnownRelationType["Abbreviation"] = "Abbreviation";
5149
+ /** DirectionOfBodyStructure */
5150
+ KnownRelationType["DirectionOfBodyStructure"] = "DirectionOfBodyStructure";
5151
+ /** DirectionOfCondition */
5152
+ KnownRelationType["DirectionOfCondition"] = "DirectionOfCondition";
5153
+ /** DirectionOfExamination */
5154
+ KnownRelationType["DirectionOfExamination"] = "DirectionOfExamination";
5155
+ /** DirectionOfTreatment */
5156
+ KnownRelationType["DirectionOfTreatment"] = "DirectionOfTreatment";
5157
+ /** DosageOfMedication */
5158
+ KnownRelationType["DosageOfMedication"] = "DosageOfMedication";
5159
+ /** FormOfMedication */
5160
+ KnownRelationType["FormOfMedication"] = "FormOfMedication";
5161
+ /** FrequencyOfMedication */
5162
+ KnownRelationType["FrequencyOfMedication"] = "FrequencyOfMedication";
5163
+ /** FrequencyOfTreatment */
5164
+ KnownRelationType["FrequencyOfTreatment"] = "FrequencyOfTreatment";
5165
+ /** QualifierOfCondition */
5166
+ KnownRelationType["QualifierOfCondition"] = "QualifierOfCondition";
5167
+ /** RelationOfExamination */
5168
+ KnownRelationType["RelationOfExamination"] = "RelationOfExamination";
5169
+ /** RouteOfMedication */
5170
+ KnownRelationType["RouteOfMedication"] = "RouteOfMedication";
5171
+ /** TimeOfCondition */
5172
+ KnownRelationType["TimeOfCondition"] = "TimeOfCondition";
5173
+ /** TimeOfEvent */
5174
+ KnownRelationType["TimeOfEvent"] = "TimeOfEvent";
5175
+ /** TimeOfExamination */
5176
+ KnownRelationType["TimeOfExamination"] = "TimeOfExamination";
5177
+ /** TimeOfMedication */
5178
+ KnownRelationType["TimeOfMedication"] = "TimeOfMedication";
5179
+ /** TimeOfTreatment */
5180
+ KnownRelationType["TimeOfTreatment"] = "TimeOfTreatment";
5181
+ /** UnitOfCondition */
5182
+ KnownRelationType["UnitOfCondition"] = "UnitOfCondition";
5183
+ /** UnitOfExamination */
5184
+ KnownRelationType["UnitOfExamination"] = "UnitOfExamination";
5185
+ /** ValueOfCondition */
5186
+ KnownRelationType["ValueOfCondition"] = "ValueOfCondition";
5187
+ /** ValueOfExamination */
5188
+ KnownRelationType["ValueOfExamination"] = "ValueOfExamination";
5189
+ })(KnownRelationType || (KnownRelationType = {}));
5190
+
4781
5191
  Object.defineProperty(exports, 'AzureKeyCredential', {
4782
5192
  enumerable: true,
4783
- get: function () {
4784
- return coreAuth.AzureKeyCredential;
4785
- }
5193
+ get: function () { return coreAuth.AzureKeyCredential; }
4786
5194
  });
4787
5195
  exports.TextAnalyticsClient = TextAnalyticsClient;
4788
5196
  //# sourceMappingURL=index.js.map