@azure/ai-text-analytics 5.2.0-beta.2 → 6.0.0-alpha.20220516.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 (103) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +375 -133
  3. package/dist/index.js +2797 -4176
  4. package/dist/index.js.map +1 -1
  5. package/dist-esm/src/azureKeyCredentialPolicy.js +2 -2
  6. package/dist-esm/src/azureKeyCredentialPolicy.js.map +1 -1
  7. package/dist-esm/src/constants.js +16 -0
  8. package/dist-esm/src/constants.js.map +1 -0
  9. package/dist-esm/src/generated/generatedClient.js +80 -334
  10. package/dist-esm/src/generated/generatedClient.js.map +1 -1
  11. package/dist-esm/src/generated/index.js +1 -1
  12. package/dist-esm/src/generated/index.js.map +1 -1
  13. package/dist-esm/src/generated/models/index.js +106 -35
  14. package/dist-esm/src/generated/models/index.js.map +1 -1
  15. package/dist-esm/src/generated/models/mappers.js +1625 -2101
  16. package/dist-esm/src/generated/models/mappers.js.map +1 -1
  17. package/dist-esm/src/generated/models/parameters.js +18 -105
  18. package/dist-esm/src/generated/models/parameters.js.map +1 -1
  19. package/dist-esm/src/generated/operations/analyzeText.js +105 -0
  20. package/dist-esm/src/generated/operations/analyzeText.js.map +1 -0
  21. package/dist-esm/src/generated/operations/index.js +9 -0
  22. package/dist-esm/src/generated/operations/index.js.map +1 -0
  23. package/dist-esm/src/generated/operationsInterfaces/analyzeText.js +9 -0
  24. package/dist-esm/src/generated/operationsInterfaces/analyzeText.js.map +1 -0
  25. package/dist-esm/src/generated/operationsInterfaces/index.js +9 -0
  26. package/dist-esm/src/generated/operationsInterfaces/index.js.map +1 -0
  27. package/dist-esm/src/index.js +14 -5
  28. package/dist-esm/src/index.js.map +1 -1
  29. package/dist-esm/src/lro.js +195 -0
  30. package/dist-esm/src/lro.js.map +1 -0
  31. package/dist-esm/src/models.js +42 -0
  32. package/dist-esm/src/models.js.map +1 -0
  33. package/dist-esm/src/textAnalysisClient.js +197 -0
  34. package/dist-esm/src/textAnalysisClient.js.map +1 -0
  35. package/dist-esm/src/transforms.js +279 -0
  36. package/dist-esm/src/transforms.js.map +1 -0
  37. package/dist-esm/src/util.js +35 -141
  38. package/dist-esm/src/util.js.map +1 -1
  39. package/package.json +24 -32
  40. package/types/ai-text-analytics.d.ts +1402 -1421
  41. package/LICENSE +0 -21
  42. package/dist-esm/src/analyzeActionsResult.js +0 -205
  43. package/dist-esm/src/analyzeActionsResult.js.map +0 -1
  44. package/dist-esm/src/analyzeHealthcareEntitiesResult.js +0 -53
  45. package/dist-esm/src/analyzeHealthcareEntitiesResult.js.map +0 -1
  46. package/dist-esm/src/analyzeLro.js +0 -132
  47. package/dist-esm/src/analyzeLro.js.map +0 -1
  48. package/dist-esm/src/analyzeSentimentResult.js +0 -74
  49. package/dist-esm/src/analyzeSentimentResult.js.map +0 -1
  50. package/dist-esm/src/analyzeSentimentResultArray.js +0 -11
  51. package/dist-esm/src/analyzeSentimentResultArray.js.map +0 -1
  52. package/dist-esm/src/detectLanguageResult.js +0 -17
  53. package/dist-esm/src/detectLanguageResult.js.map +0 -1
  54. package/dist-esm/src/detectLanguageResultArray.js +0 -11
  55. package/dist-esm/src/detectLanguageResultArray.js.map +0 -1
  56. package/dist-esm/src/extractKeyPhrasesResult.js +0 -17
  57. package/dist-esm/src/extractKeyPhrasesResult.js.map +0 -1
  58. package/dist-esm/src/extractKeyPhrasesResultArray.js +0 -11
  59. package/dist-esm/src/extractKeyPhrasesResultArray.js.map +0 -1
  60. package/dist-esm/src/extractSummaryResult.js +0 -17
  61. package/dist-esm/src/extractSummaryResult.js.map +0 -1
  62. package/dist-esm/src/extractSummaryResultArray.js +0 -11
  63. package/dist-esm/src/extractSummaryResultArray.js.map +0 -1
  64. package/dist-esm/src/generated/generatedClientContext.js +0 -42
  65. package/dist-esm/src/generated/generatedClientContext.js.map +0 -1
  66. package/dist-esm/src/healthLro.js +0 -139
  67. package/dist-esm/src/healthLro.js.map +0 -1
  68. package/dist-esm/src/multiCategoryClassifyResult.js +0 -17
  69. package/dist-esm/src/multiCategoryClassifyResult.js.map +0 -1
  70. package/dist-esm/src/multiCategoryClassifyResultArray.js +0 -11
  71. package/dist-esm/src/multiCategoryClassifyResultArray.js.map +0 -1
  72. package/dist-esm/src/pollerModels.js +0 -4
  73. package/dist-esm/src/pollerModels.js.map +0 -1
  74. package/dist-esm/src/recognizeCategorizedEntitiesResult.js +0 -17
  75. package/dist-esm/src/recognizeCategorizedEntitiesResult.js.map +0 -1
  76. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js +0 -11
  77. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js.map +0 -1
  78. package/dist-esm/src/recognizeCustomEntitiesResult.js +0 -17
  79. package/dist-esm/src/recognizeCustomEntitiesResult.js.map +0 -1
  80. package/dist-esm/src/recognizeCustomEntitiesResultArray.js +0 -11
  81. package/dist-esm/src/recognizeCustomEntitiesResultArray.js.map +0 -1
  82. package/dist-esm/src/recognizeLinkedEntitiesResult.js +0 -17
  83. package/dist-esm/src/recognizeLinkedEntitiesResult.js.map +0 -1
  84. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js +0 -11
  85. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js.map +0 -1
  86. package/dist-esm/src/recognizePiiEntitiesResult.js +0 -18
  87. package/dist-esm/src/recognizePiiEntitiesResult.js.map +0 -1
  88. package/dist-esm/src/recognizePiiEntitiesResultArray.js +0 -11
  89. package/dist-esm/src/recognizePiiEntitiesResultArray.js.map +0 -1
  90. package/dist-esm/src/singleCategoryClassifyResult.js +0 -17
  91. package/dist-esm/src/singleCategoryClassifyResult.js.map +0 -1
  92. package/dist-esm/src/singleCategoryClassifyResultArray.js +0 -11
  93. package/dist-esm/src/singleCategoryClassifyResultArray.js.map +0 -1
  94. package/dist-esm/src/textAnalyticsAction.js +0 -4
  95. package/dist-esm/src/textAnalyticsAction.js.map +0 -1
  96. package/dist-esm/src/textAnalyticsClient.js +0 -511
  97. package/dist-esm/src/textAnalyticsClient.js.map +0 -1
  98. package/dist-esm/src/textAnalyticsOperationOptions.js +0 -4
  99. package/dist-esm/src/textAnalyticsOperationOptions.js.map +0 -1
  100. package/dist-esm/src/textAnalyticsResult.js +0 -94
  101. package/dist-esm/src/textAnalyticsResult.js.map +0 -1
  102. package/dist-esm/src/tracing.js +0 -12
  103. package/dist-esm/src/tracing.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"analyzeSentimentResultArray.js","sourceRoot":"","sources":["../../src/analyzeSentimentResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,+BAA+B,EAC/B,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mEAAmE,EAAE,MAAM,uBAAuB,CAAC;AAoB5G;;GAEG;AACH,MAAM,UAAU,+BAA+B,CAC7C,KAA0B,EAC1B,QAA2B;IAE3B,OAAO,mEAAmE,CACxE,KAAK,EACL,QAAQ,EACR,0BAA0B,EAC1B,+BAA+B,CAChC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n TextDocumentBatchStatistics,\n TextDocumentInput,\n SentimentResponse\n} from \"./generated/models\";\nimport {\n AnalyzeSentimentResult,\n makeAnalyzeSentimentErrorResult,\n makeAnalyzeSentimentResult\n} from \"./analyzeSentimentResult\";\nimport { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from \"./textAnalyticsResult\";\n\n/**\n * Array of `AnalyzeSentimentResult` objects corresponding to a batch of input documents, and\n * annotated with information about the batch operation.\n */\nexport interface AnalyzeSentimentResultArray extends Array<AnalyzeSentimentResult> {\n /**\n * Statistics about the input document batch and how it was processed\n * by the service. This property will have a value when includeStatistics is set to true\n * in the client call.\n */\n statistics?: TextDocumentBatchStatistics;\n /**\n * The version of the text analytics model used by this operation on this\n * batch of input documents.\n */\n modelVersion: string;\n}\n\n/**\n * @internal\n */\nexport function makeAnalyzeSentimentResultArray(\n input: TextDocumentInput[],\n response: SentimentResponse\n): AnalyzeSentimentResultArray {\n return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(\n input,\n response,\n makeAnalyzeSentimentResult,\n makeAnalyzeSentimentErrorResult\n );\n}\n"]}
@@ -1,17 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
4
- /**
5
- * @internal
6
- */
7
- export function makeDetectLanguageResult(response) {
8
- const { id, warnings, statistics, detectedLanguage } = response;
9
- return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { primaryLanguage: detectedLanguage });
10
- }
11
- /**
12
- * @internal
13
- */
14
- export function makeDetectLanguageErrorResult(id, error) {
15
- return makeTextAnalyticsErrorResult(id, error);
16
- }
17
- //# sourceMappingURL=detectLanguageResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detectLanguageResult.js","sourceRoot":"","sources":["../../src/detectLanguageResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;AAwB/B;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAA0B;IACjE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,QAAQ,CAAC;IAChE,uCACK,8BAA8B,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,KAC3D,eAAe,EAAE,gBAAgB,IACjC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAC3C,EAAU,EACV,KAAyB;IAEzB,OAAO,4BAA4B,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n makeTextAnalyticsSuccessResult,\n TextAnalyticsSuccessResult,\n TextAnalyticsErrorResult,\n makeTextAnalyticsErrorResult\n} from \"./textAnalyticsResult\";\nimport { DetectedLanguage, TextAnalyticsError, DocumentLanguage } from \"./generated/models\";\n\n/**\n * The result of the detect language operation on a single document.\n */\nexport type DetectLanguageResult = DetectLanguageSuccessResult | DetectLanguageErrorResult;\n\n/**\n * The result of the detect language operation on a single document,\n * containing a prediction of what language the document is written in.\n */\nexport interface DetectLanguageSuccessResult extends TextAnalyticsSuccessResult {\n /**\n * The top detected language by confidence score.\n */\n readonly primaryLanguage: DetectedLanguage;\n}\n\n/**\n * An error result from the detect languge operation on a single document.\n */\nexport type DetectLanguageErrorResult = TextAnalyticsErrorResult;\n\n/**\n * @internal\n */\nexport function makeDetectLanguageResult(response: DocumentLanguage): DetectLanguageSuccessResult {\n const { id, warnings, statistics, detectedLanguage } = response;\n return {\n ...makeTextAnalyticsSuccessResult(id, warnings, statistics),\n primaryLanguage: detectedLanguage\n };\n}\n\n/**\n * @internal\n */\nexport function makeDetectLanguageErrorResult(\n id: string,\n error: TextAnalyticsError\n): DetectLanguageErrorResult {\n return makeTextAnalyticsErrorResult(id, error);\n}\n"]}
@@ -1,11 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeDetectLanguageResult, makeDetectLanguageErrorResult } from "./detectLanguageResult";
4
- import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from "./textAnalyticsResult";
5
- /**
6
- * @internal
7
- */
8
- export function makeDetectLanguageResultArray(input, response) {
9
- return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(input, response, makeDetectLanguageResult, makeDetectLanguageErrorResult);
10
- }
11
- //# sourceMappingURL=detectLanguageResultArray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detectLanguageResultArray.js","sourceRoot":"","sources":["../../src/detectLanguageResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAEL,wBAAwB,EACxB,6BAA6B,EAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,mEAAmE,EAAE,MAAM,uBAAuB,CAAC;AAoB5G;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAC3C,KAA0B,EAC1B,QAAwB;IAExB,OAAO,mEAAmE,CACxE,KAAK,EACL,QAAQ,EACR,wBAAwB,EACxB,6BAA6B,CAC9B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TextDocumentBatchStatistics, LanguageResult, TextDocumentInput } from \"./generated/models\";\nimport {\n DetectLanguageResult,\n makeDetectLanguageResult,\n makeDetectLanguageErrorResult\n} from \"./detectLanguageResult\";\nimport { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from \"./textAnalyticsResult\";\n\n/**\n * Array of `DetectLanguageResult` objects corresponding to a batch of input documents, and\n * annotated with information about the batch operation.\n */\nexport interface DetectLanguageResultArray extends Array<DetectLanguageResult> {\n /**\n * Statistics about the input document batch and how it was processed\n * by the service. This property will have a value when includeStatistics is set to true\n * in the client call.\n */\n statistics?: TextDocumentBatchStatistics;\n /**\n * The version of the text analytics model used by this operation on this\n * batch of input documents.\n */\n modelVersion: string;\n}\n\n/**\n * @internal\n */\nexport function makeDetectLanguageResultArray(\n input: TextDocumentInput[],\n response: LanguageResult\n): DetectLanguageResultArray {\n return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(\n input,\n response,\n makeDetectLanguageResult,\n makeDetectLanguageErrorResult\n );\n}\n"]}
@@ -1,17 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
4
- /**
5
- * @internal
6
- */
7
- export function makeExtractKeyPhrasesResult(result) {
8
- const { id, warnings, statistics, keyPhrases } = result;
9
- return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { keyPhrases });
10
- }
11
- /**
12
- * @internal
13
- */
14
- export function makeExtractKeyPhrasesErrorResult(id, error) {
15
- return makeTextAnalyticsErrorResult(id, error);
16
- }
17
- //# sourceMappingURL=extractKeyPhrasesResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extractKeyPhrasesResult.js","sourceRoot":"","sources":["../../src/extractKeyPhrasesResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;AAyB/B;;GAEG;AACH,MAAM,UAAU,2BAA2B,CACzC,MAA0B;IAE1B,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACxD,uCACK,8BAA8B,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,KAC3D,UAAU,IACV;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAC9C,EAAU,EACV,KAAyB;IAEzB,OAAO,4BAA4B,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n makeTextAnalyticsSuccessResult,\n TextAnalyticsSuccessResult,\n TextAnalyticsErrorResult,\n makeTextAnalyticsErrorResult\n} from \"./textAnalyticsResult\";\nimport { TextAnalyticsError, DocumentKeyPhrases } from \"./generated/models\";\n\n/**\n * The result of the extract key phrases operation on a single document.\n */\nexport type ExtractKeyPhrasesResult = ExtractKeyPhrasesSuccessResult | ExtractKeyPhrasesErrorResult;\n\n/**\n * The result of the extract key phrases operation on a single document,\n * containing a collection of the key phrases identified in that document.\n */\nexport interface ExtractKeyPhrasesSuccessResult extends TextAnalyticsSuccessResult {\n /**\n * A list of representative words or phrases. The number of key phrases returned is proportional\n * to the number of words in the input document.\n */\n keyPhrases: string[];\n}\n\n/**\n * An error result from the extract key phrases operation on a single document.\n */\nexport type ExtractKeyPhrasesErrorResult = TextAnalyticsErrorResult;\n\n/**\n * @internal\n */\nexport function makeExtractKeyPhrasesResult(\n result: DocumentKeyPhrases\n): ExtractKeyPhrasesSuccessResult {\n const { id, warnings, statistics, keyPhrases } = result;\n return {\n ...makeTextAnalyticsSuccessResult(id, warnings, statistics),\n keyPhrases\n };\n}\n\n/**\n * @internal\n */\nexport function makeExtractKeyPhrasesErrorResult(\n id: string,\n error: TextAnalyticsError\n): ExtractKeyPhrasesErrorResult {\n return makeTextAnalyticsErrorResult(id, error);\n}\n"]}
@@ -1,11 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeExtractKeyPhrasesResult, makeExtractKeyPhrasesErrorResult } from "./extractKeyPhrasesResult";
4
- import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from "./textAnalyticsResult";
5
- /**
6
- * @internal
7
- */
8
- export function makeExtractKeyPhrasesResultArray(input, response) {
9
- return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(input, response, makeExtractKeyPhrasesResult, makeExtractKeyPhrasesErrorResult);
10
- }
11
- //# sourceMappingURL=extractKeyPhrasesResultArray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extractKeyPhrasesResultArray.js","sourceRoot":"","sources":["../../src/extractKeyPhrasesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,2BAA2B,EAC3B,gCAAgC,EACjC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mEAAmE,EAAE,MAAM,uBAAuB,CAAC;AAoB5G;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAC9C,KAA0B,EAC1B,QAAyB;IAEzB,OAAO,mEAAmE,CACxE,KAAK,EACL,QAAQ,EACR,2BAA2B,EAC3B,gCAAgC,CACjC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n TextDocumentBatchStatistics,\n TextDocumentInput,\n KeyPhraseResult\n} from \"./generated/models\";\nimport {\n ExtractKeyPhrasesResult,\n makeExtractKeyPhrasesResult,\n makeExtractKeyPhrasesErrorResult\n} from \"./extractKeyPhrasesResult\";\nimport { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from \"./textAnalyticsResult\";\n\n/**\n * Array of `ExtractKeyPhrasesResult` objects corresponding to a batch of input documents, and\n * annotated with information about the batch operation.\n */\nexport interface ExtractKeyPhrasesResultArray extends Array<ExtractKeyPhrasesResult> {\n /**\n * Statistics about the input document batch and how it was processed\n * by the service. This property will have a value when includeStatistics is set to true\n * in the client call.\n */\n statistics?: TextDocumentBatchStatistics;\n /**\n * The version of the text analytics model used by this operation on this\n * batch of input documents.\n */\n modelVersion: string;\n}\n\n/**\n * @internal\n */\nexport function makeExtractKeyPhrasesResultArray(\n input: TextDocumentInput[],\n response: KeyPhraseResult\n): ExtractKeyPhrasesResultArray {\n return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(\n input,\n response,\n makeExtractKeyPhrasesResult,\n makeExtractKeyPhrasesErrorResult\n );\n}\n"]}
@@ -1,17 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
4
- /**
5
- * @internal
6
- */
7
- export function makeExtractSummaryResult(result) {
8
- const { id, warnings, statistics, sentences } = result;
9
- return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { sentences: sentences.map((sentence) => (Object.assign({}, sentence))) });
10
- }
11
- /**
12
- * @internal
13
- */
14
- export function makeExtractSummaryErrorResult(id, error) {
15
- return makeTextAnalyticsErrorResult(id, error);
16
- }
17
- //# sourceMappingURL=extractSummaryResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extractSummaryResult.js","sourceRoot":"","sources":["../../src/extractSummaryResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;AA0C/B;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,MAAgC;IAEhC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IACvD,uCACK,8BAA8B,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,KAC3D,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,QAAmC,EAAE,EAAE,CAAC,mBAC7D,QAAQ,EACX,CAAC,IACH;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAC3C,EAAU,EACV,KAAyB;IAEzB,OAAO,4BAA4B,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n makeTextAnalyticsSuccessResult,\n TextAnalyticsSuccessResult,\n TextAnalyticsErrorResult,\n makeTextAnalyticsErrorResult\n} from \"./textAnalyticsResult\";\nimport {\n TextAnalyticsError,\n ExtractedDocumentSummary,\n ExtractedSummarySentence as GeneratedSummarySentences\n} from \"./generated/models\";\n\n/**\n * The result of the extract summary operation on a single document.\n */\nexport type ExtractSummaryResult = ExtractSummarySuccessResult | ExtractSummaryErrorResult;\n\n/**\n * The result of the extract summary operation on a single document,\n * containing a collection of the summary identified in that document.\n */\nexport interface ExtractSummarySuccessResult extends TextAnalyticsSuccessResult {\n /**\n * A list of sentences composing a summary of the input document.\n */\n sentences: SummarySentence[];\n}\n\n/**\n * An extracted sentence as part of the summary of a document.\n */\nexport interface SummarySentence {\n /** The extracted sentence text. */\n text: string;\n /** A double value representing the relevance of the sentence within the summary. Higher values indicate higher importance. */\n rankScore: number;\n /** The sentence offset from the start of the document, based on the value of the stringIndexType parameter. */\n offset: number;\n /** The length of the sentence. */\n length: number;\n}\n\n/**\n * An error result from the extract summary operation on a single document.\n */\nexport type ExtractSummaryErrorResult = TextAnalyticsErrorResult;\n\n/**\n * @internal\n */\nexport function makeExtractSummaryResult(\n result: ExtractedDocumentSummary\n): ExtractSummarySuccessResult {\n const { id, warnings, statistics, sentences } = result;\n return {\n ...makeTextAnalyticsSuccessResult(id, warnings, statistics),\n sentences: sentences.map((sentence: GeneratedSummarySentences) => ({\n ...sentence\n }))\n };\n}\n\n/**\n * @internal\n */\nexport function makeExtractSummaryErrorResult(\n id: string,\n error: TextAnalyticsError\n): ExtractSummaryErrorResult {\n return makeTextAnalyticsErrorResult(id, error);\n}\n"]}
@@ -1,11 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeExtractSummaryResult, makeExtractSummaryErrorResult } from "./extractSummaryResult";
4
- import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from "./textAnalyticsResult";
5
- /**
6
- * @internal
7
- */
8
- export function makeExtractSummaryResultArray(input, response) {
9
- return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(input, response, makeExtractSummaryResult, makeExtractSummaryErrorResult);
10
- }
11
- //# sourceMappingURL=extractSummaryResultArray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extractSummaryResultArray.js","sourceRoot":"","sources":["../../src/extractSummaryResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,wBAAwB,EACxB,6BAA6B,EAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,mEAAmE,EAAE,MAAM,uBAAuB,CAAC;AAoB5G;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAC3C,KAA0B,EAC1B,QAAuC;IAEvC,OAAO,mEAAmE,CACxE,KAAK,EACL,QAAQ,EACR,wBAAwB,EACxB,6BAA6B,CAC9B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n TextDocumentBatchStatistics,\n TextDocumentInput,\n ExtractiveSummarizationResult\n} from \"./generated/models\";\nimport {\n ExtractSummaryResult,\n makeExtractSummaryResult,\n makeExtractSummaryErrorResult\n} from \"./extractSummaryResult\";\nimport { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from \"./textAnalyticsResult\";\n\n/**\n * Array of `ExtractSummaryResult` objects corresponding to a batch of input documents, and\n * annotated with information about the batch operation.\n */\nexport interface ExtractSummaryResultArray extends Array<ExtractSummaryResult> {\n /**\n * Statistics about the input document batch and how it was processed\n * by the service. This property will have a value when includeStatistics is set to true\n * in the client call.\n */\n statistics?: TextDocumentBatchStatistics;\n /**\n * The version of the text analytics model used by this operation on this\n * batch of input documents.\n */\n modelVersion: string;\n}\n\n/**\n * @internal\n */\nexport function makeExtractSummaryResultArray(\n input: TextDocumentInput[],\n response: ExtractiveSummarizationResult\n): ExtractSummaryResultArray {\n return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(\n input,\n response,\n makeExtractSummaryResult,\n makeExtractSummaryErrorResult\n );\n}\n"]}
@@ -1,42 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import * as coreClient from "@azure/core-client";
9
- /** @internal */
10
- export class GeneratedClientContext extends coreClient.ServiceClient {
11
- /**
12
- * Initializes a new instance of the GeneratedClientContext class.
13
- * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example:
14
- * https://westus.api.cognitive.microsoft.com).
15
- * @param options The parameter options
16
- */
17
- constructor(endpoint, options) {
18
- if (endpoint === undefined) {
19
- throw new Error("'endpoint' cannot be null");
20
- }
21
- // Initializing default values for options
22
- if (!options) {
23
- options = {};
24
- }
25
- const defaults = {
26
- requestContentType: "application/json; charset=utf-8"
27
- };
28
- const packageDetails = `azsdk-js-ai-text-analytics/5.2.0-beta.2`;
29
- const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
30
- ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
31
- : `${packageDetails}`;
32
- const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
33
- userAgentPrefix
34
- }, baseUri: options.endpoint || "{Endpoint}/text/analytics/{ApiVersion}" });
35
- super(optionsWithDefaults);
36
- // Parameter assignments
37
- this.endpoint = endpoint;
38
- // Assigning values to Constant parameters
39
- this.apiVersion = options.apiVersion || "v3.2-preview.2";
40
- }
41
- }
42
- //# sourceMappingURL=generatedClientContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generatedClientContext.js","sourceRoot":"","sources":["../../../src/generated/generatedClientContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAGjD,gBAAgB;AAChB,MAAM,OAAO,sBAAuB,SAAQ,UAAU,CAAC,aAAa;IAIlE;;;;;OAKG;IACH,YAAY,QAAgB,EAAE,OAAuC;QACnE,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAC9C;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;QACD,MAAM,QAAQ,GAAkC;YAC9C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,yCAAyC,CAAC;QACjE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,OAAO,EAAE,OAAO,CAAC,QAAQ,IAAI,wCAAwC,GACtE,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,0CAA0C;QAC1C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,gBAAgB,CAAC;IAC3D,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport { GeneratedClientOptionalParams } from \"./models\";\n\n/** @internal */\nexport class GeneratedClientContext extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the GeneratedClientContext class.\n * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example:\n * https://westus.api.cognitive.microsoft.com).\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: GeneratedClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: GeneratedClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-ai-text-analytics/5.2.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint || \"{Endpoint}/text/analytics/{ApiVersion}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"v3.2-preview.2\";\n }\n}\n"]}
@@ -1,139 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { SpanStatusCode } from "@azure/core-tracing";
4
- import { createSerializer } from "@azure/core-client";
5
- import { makeHealthcareEntitiesErrorResult, makeHealthcareEntitiesResult } from "./analyzeHealthcareEntitiesResult";
6
- import { createSpan } from "./tracing";
7
- import { addStrEncodingParam, getRawResponse, compileError, sendGetRequest } from "./util";
8
- import * as Mappers from "./generated/models/mappers";
9
- import { accept, apiVersion, endpoint, includeStatistics, skip, top } from "./generated/models/parameters";
10
- import { processAndCombineSuccessfulAndErroneousDocuments } from "./textAnalyticsResult";
11
- import { getPagedAsyncIterator } from "@azure/core-paging";
12
- const serializer = createSerializer(Mappers, /* isXml */ false);
13
- // Consider whether the spec can be exported by code gen
14
- const healthStatusOperationSpec = {
15
- path: "/entities/health/jobs/{jobId}",
16
- httpMethod: "GET",
17
- responses: {
18
- 200: {
19
- bodyMapper: Mappers.HealthcareJobState
20
- },
21
- default: {
22
- bodyMapper: Mappers.ErrorResponse
23
- }
24
- },
25
- queryParameters: [includeStatistics, top, skip],
26
- urlParameters: [endpoint, apiVersion],
27
- headerParameters: [accept],
28
- serializer
29
- };
30
- /**
31
- * @internal
32
- */
33
- export class HealthLro {
34
- constructor(
35
- // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters
36
- client, baseOptions, initOptions, pollOptions, documents) {
37
- this.client = client;
38
- this.baseOptions = baseOptions;
39
- this.initOptions = initOptions;
40
- this.pollOptions = pollOptions;
41
- this.documents = documents;
42
- this.requestMethod = "POST";
43
- this.requestPath = "/entities/health/jobs";
44
- }
45
- async sendInitialRequest() {
46
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-beginAnalyzeHealthcare", Object.assign(Object.assign({}, this.baseOptions), addStrEncodingParam(this.initOptions)));
47
- try {
48
- const { flatResponse, rawResponse } = await getRawResponse((paramOptions) => this.client.health({ documents: this.documents }, paramOptions), finalOptions);
49
- return {
50
- flatResponse: flatResponse,
51
- rawResponse
52
- };
53
- }
54
- catch (e) {
55
- const exception = compileError(e);
56
- span.setStatus({
57
- code: SpanStatusCode.ERROR,
58
- message: exception.message
59
- });
60
- throw exception;
61
- }
62
- finally {
63
- span.end();
64
- }
65
- }
66
- async sendPollRequest(path) {
67
- return sendGetRequest(this.client, healthStatusOperationSpec, "HealthStatus", Object.assign(Object.assign({}, this.baseOptions), this.pollOptions), path);
68
- }
69
- }
70
- /**
71
- * @internal
72
- */
73
- export function isHealthDone(response) {
74
- var _a;
75
- const castResponse = response;
76
- switch (castResponse.status) {
77
- case "notStarted":
78
- case "running":
79
- return false;
80
- case "failed": {
81
- const errors = (_a = castResponse.errors) === null || _a === void 0 ? void 0 : _a.map((e) => ` code ${e.code}, message: '${e.message}'`).join("\n");
82
- const message = `Healthcare analysis failed. Error(s): ${errors || ""}`;
83
- throw new Error(message);
84
- }
85
- default: {
86
- if (castResponse.results) {
87
- return true;
88
- }
89
- else {
90
- throw new Error("Healthcare action has finished but the there are no results!");
91
- }
92
- }
93
- }
94
- }
95
- /**
96
- * @internal
97
- */
98
- export function processHealthResult(
99
- // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters
100
- client, documents, options) {
101
- return (result, state) => {
102
- const pollingURL = state.pollingURL;
103
- const pagedResult = {
104
- firstPageLink: pollingURL,
105
- getPage: async (pageLink, maxPageSize) => {
106
- const response = await sendGetRequest(client, healthStatusOperationSpec, "HealthStatus",
107
- // if `top` is set to `undefined`, the default value will not be sent
108
- // as part of the request.
109
- maxPageSize ? Object.assign(Object.assign({}, options), { top: maxPageSize }) : options, pageLink);
110
- const flatResponse = response.flatResponse;
111
- if (flatResponse.results) {
112
- return {
113
- page: processAndCombineSuccessfulAndErroneousDocuments(documents, flatResponse.results, makeHealthcareEntitiesResult, makeHealthcareEntitiesErrorResult),
114
- nextPageLink: flatResponse.nextLink
115
- };
116
- }
117
- else {
118
- throw new Error("Healthcare action has succeeded but there are no results!");
119
- }
120
- }
121
- };
122
- const pagedIterator = getPagedAsyncIterator(pagedResult);
123
- return Object.assign(pagedIterator, {
124
- statistics: result.results.statistics,
125
- modelVersion: result.results.modelVersion
126
- });
127
- };
128
- }
129
- /**
130
- * @internal
131
- */
132
- export function updateHealthState(state, lastResponse) {
133
- const response = lastResponse.body;
134
- state.createdOn = response.createdDateTime;
135
- state.lastModifiedOn = response.lastUpdateDateTime;
136
- state.expiresOn = response.expirationDateTime;
137
- state.status = response.status;
138
- }
139
- //# sourceMappingURL=healthLro.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"healthLro.js","sourceRoot":"","sources":["../../src/healthLro.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LongRunningOperation, LroResponse, PollerLike, RawResponse } from \"@azure/core-lro\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport { createSerializer, OperationOptions, OperationSpec } from \"@azure/core-client\";\nimport {\n AnalyzeHealthcareEntitiesResult,\n AnalyzeHealthcareEntitiesResultArray,\n makeHealthcareEntitiesErrorResult,\n makeHealthcareEntitiesResult,\n PagedAnalyzeHealthcareEntitiesResult\n} from \"./analyzeHealthcareEntitiesResult\";\nimport {\n GeneratedClient,\n GeneratedClientHealthStatusOptionalParams,\n GeneratedClientHealthStatusResponse,\n TextDocumentInput\n} from \"./generated\";\nimport { createSpan } from \"./tracing\";\nimport {\n addStrEncodingParam,\n getRawResponse,\n compileError,\n sendGetRequest,\n StringIndexType\n} from \"./util\";\nimport * as Mappers from \"./generated/models/mappers\";\nimport {\n accept,\n apiVersion,\n endpoint,\n includeStatistics,\n skip,\n top\n} from \"./generated/models/parameters\";\nimport { processAndCombineSuccessfulAndErroneousDocuments } from \"./textAnalyticsResult\";\nimport { getPagedAsyncIterator, PagedResult } from \"@azure/core-paging\";\nimport { AnalysisPollOperationState } from \"./pollerModels\";\nimport { TextAnalyticsOperationOptions } from \"./textAnalyticsOperationOptions\";\n\n/**\n * Options for the begin analyze healthcare entities operation.\n */\nexport interface BeginAnalyzeHealthcareEntitiesOptions extends TextAnalyticsOperationOptions {\n /**\n * Delay to wait until next poll, in milliseconds.\n */\n stringIndexType?: StringIndexType;\n /**\n * Delay to wait until next poll, in milliseconds.\n */\n updateIntervalInMs?: number;\n /**\n * A serialized poller which can be used to resume an existing paused Long-Running-Operation.\n */\n resumeFrom?: string;\n}\n\n/**\n * Result type of the Health Long-Running-Operation (LRO)\n */\nexport type AnalyzeHealthcareEntitiesPollerLike = PollerLike<\n AnalyzeHealthcareOperationState,\n PagedAnalyzeHealthcareEntitiesResult\n>;\n\n/**\n * The state of the begin analyze healthcare polling operation.\n */\nexport interface AnalyzeHealthcareOperationState\n extends AnalysisPollOperationState<PagedAnalyzeHealthcareEntitiesResult> {}\n\nconst serializer = createSerializer(Mappers, /* isXml */ false);\n\n// Consider whether the spec can be exported by code gen\nconst healthStatusOperationSpec: OperationSpec = {\n path: \"/entities/health/jobs/{jobId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.HealthcareJobState\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [includeStatistics, top, skip],\n urlParameters: [endpoint, apiVersion],\n headerParameters: [accept],\n serializer\n};\n\n/**\n * @internal\n */\nexport class HealthLro implements LongRunningOperation<PagedAnalyzeHealthcareEntitiesResult> {\n public requestMethod = \"POST\";\n public requestPath = \"/entities/health/jobs\";\n constructor(\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n private client: GeneratedClient,\n private baseOptions: OperationOptions,\n private initOptions: {\n modelVersion?: string;\n stringIndexType?: StringIndexType;\n loggingOptOut?: boolean;\n },\n private pollOptions: {\n includeStatistics?: boolean;\n },\n private documents: TextDocumentInput[]\n ) {}\n async sendInitialRequest(): Promise<LroResponse<PagedAnalyzeHealthcareEntitiesResult>> {\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-beginAnalyzeHealthcare\",\n {\n ...this.baseOptions,\n ...addStrEncodingParam(this.initOptions)\n }\n );\n try {\n const { flatResponse, rawResponse } = await getRawResponse(\n (paramOptions) => this.client.health({ documents: this.documents }, paramOptions),\n finalOptions\n );\n return {\n flatResponse: flatResponse as PagedAnalyzeHealthcareEntitiesResult,\n rawResponse\n };\n } catch (e) {\n const exception = compileError(e);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: exception.message\n });\n throw exception;\n } finally {\n span.end();\n }\n }\n async sendPollRequest(path: string): Promise<LroResponse<PagedAnalyzeHealthcareEntitiesResult>> {\n return sendGetRequest(\n this.client,\n healthStatusOperationSpec,\n \"HealthStatus\",\n { ...this.baseOptions, ...this.pollOptions },\n path\n ) as Promise<LroResponse<PagedAnalyzeHealthcareEntitiesResult>>;\n }\n}\n\n/**\n * @internal\n */\nexport function isHealthDone(response: unknown): boolean {\n const castResponse = response as GeneratedClientHealthStatusResponse;\n switch (castResponse.status) {\n case \"notStarted\":\n case \"running\":\n return false;\n case \"failed\": {\n const errors = castResponse.errors\n ?.map((e) => ` code ${e.code}, message: '${e.message}'`)\n .join(\"\\n\");\n const message = `Healthcare analysis failed. Error(s): ${errors || \"\"}`;\n throw new Error(message);\n }\n default: {\n if (castResponse.results) {\n return true;\n } else {\n throw new Error(\"Healthcare action has finished but the there are no results!\");\n }\n }\n }\n}\n\n/**\n * @internal\n */\nexport function processHealthResult(\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n client: GeneratedClient,\n documents: TextDocumentInput[],\n options: GeneratedClientHealthStatusOptionalParams\n): (\n result: unknown,\n state: AnalyzeHealthcareOperationState\n) => PagedAnalyzeHealthcareEntitiesResult {\n return (\n result: unknown,\n state: AnalyzeHealthcareOperationState\n ): PagedAnalyzeHealthcareEntitiesResult => {\n const pollingURL = (state as any).pollingURL;\n const pagedResult: PagedResult<AnalyzeHealthcareEntitiesResultArray> = {\n firstPageLink: pollingURL,\n getPage: async (pageLink: string, maxPageSize?: number) => {\n const response = await sendGetRequest(\n client,\n healthStatusOperationSpec,\n \"HealthStatus\",\n // if `top` is set to `undefined`, the default value will not be sent\n // as part of the request.\n maxPageSize ? { ...options, top: maxPageSize } : options,\n pageLink\n );\n const flatResponse = response.flatResponse as GeneratedClientHealthStatusResponse;\n if (flatResponse.results) {\n return {\n page: processAndCombineSuccessfulAndErroneousDocuments(\n documents,\n flatResponse.results,\n makeHealthcareEntitiesResult,\n makeHealthcareEntitiesErrorResult\n ),\n nextPageLink: flatResponse.nextLink\n };\n } else {\n throw new Error(\"Healthcare action has succeeded but there are no results!\");\n }\n }\n };\n const pagedIterator = getPagedAsyncIterator<\n AnalyzeHealthcareEntitiesResult,\n AnalyzeHealthcareEntitiesResultArray\n >(pagedResult);\n return Object.assign(pagedIterator, {\n statistics: (result as any).results.statistics,\n modelVersion: (result as any).results.modelVersion!\n });\n };\n}\n\n/**\n * @internal\n */\nexport function updateHealthState(\n state: AnalyzeHealthcareOperationState,\n lastResponse: RawResponse\n): void {\n const response = lastResponse.body as any;\n state.createdOn = response.createdDateTime;\n state.lastModifiedOn = response.lastUpdateDateTime;\n state.expiresOn = response.expirationDateTime;\n state.status = response.status;\n}\n"]}
@@ -1,17 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
4
- /**
5
- * @internal
6
- */
7
- export function makeMultiCategoryClassifyResult(result) {
8
- const { id, warnings, statistics, classifications } = result;
9
- return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { classifications });
10
- }
11
- /**
12
- * @internal
13
- */
14
- export function makeMultiCategoryClassifyErrorResult(id, error) {
15
- return makeTextAnalyticsErrorResult(id, error);
16
- }
17
- //# sourceMappingURL=multiCategoryClassifyResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"multiCategoryClassifyResult.js","sourceRoot":"","sources":["../../src/multiCategoryClassifyResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;AA2B/B;;GAEG;AACH,MAAM,UAAU,+BAA+B,CAC7C,MAAmC;IAEnC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IAC7D,uCACK,8BAA8B,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,KAC3D,eAAe,IACf;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oCAAoC,CAClD,EAAU,EACV,KAAyB;IAEzB,OAAO,4BAA4B,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n makeTextAnalyticsSuccessResult,\n TextAnalyticsSuccessResult,\n TextAnalyticsErrorResult,\n makeTextAnalyticsErrorResult\n} from \"./textAnalyticsResult\";\nimport { TextAnalyticsError, MultiClassificationDocument } from \"./generated/models\";\nimport { ClassificationCategory } from \"./singleCategoryClassifyResult\";\n\n/**\n * The result of the custom classify document multi categories operation on a multi document.\n */\nexport type MultiCategoryClassifyResult =\n | MultiCategoryClassifySuccessResult\n | MultiCategoryClassifyErrorResult;\n\n/**\n * The result of the custom classify document multi categories operation on a multi document,\n * containing the result of the classification.\n */\nexport interface MultiCategoryClassifySuccessResult extends TextAnalyticsSuccessResult {\n /**\n * The collection of classifications in the input document.\n */\n classifications: ClassificationCategory[];\n}\n\n/**\n * An error result from the custom classify document multi category operation on a multi document.\n */\nexport type MultiCategoryClassifyErrorResult = TextAnalyticsErrorResult;\n\n/**\n * @internal\n */\nexport function makeMultiCategoryClassifyResult(\n result: MultiClassificationDocument\n): MultiCategoryClassifySuccessResult {\n const { id, warnings, statistics, classifications } = result;\n return {\n ...makeTextAnalyticsSuccessResult(id, warnings, statistics),\n classifications\n };\n}\n\n/**\n * @internal\n */\nexport function makeMultiCategoryClassifyErrorResult(\n id: string,\n error: TextAnalyticsError\n): MultiCategoryClassifyErrorResult {\n return makeTextAnalyticsErrorResult(id, error);\n}\n"]}
@@ -1,11 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeMultiCategoryClassifyResult, makeMultiCategoryClassifyErrorResult } from "./multiCategoryClassifyResult";
4
- import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo } from "./textAnalyticsResult";
5
- /**
6
- * @internal
7
- */
8
- export function makeMultiCategoryClassifyResultArray(input, response) {
9
- return combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo(input, response, makeMultiCategoryClassifyResult, makeMultiCategoryClassifyErrorResult);
10
- }
11
- //# sourceMappingURL=multiCategoryClassifyResultArray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"multiCategoryClassifyResultArray.js","sourceRoot":"","sources":["../../src/multiCategoryClassifyResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,+BAA+B,EAC/B,oCAAoC,EACrC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,wEAAwE,EAAE,MAAM,uBAAuB,CAAC;AAyBjH;;GAEG;AACH,MAAM,UAAU,oCAAoC,CAClD,KAA0B,EAC1B,QAAyC;IAEzC,OAAO,wEAAwE,CAC7E,KAAK,EACL,QAAQ,EACR,+BAA+B,EAC/B,oCAAoC,CACrC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n TextDocumentBatchStatistics,\n TextDocumentInput,\n CustomMultiClassificationResult\n} from \"./generated/models\";\nimport {\n MultiCategoryClassifyResult,\n makeMultiCategoryClassifyResult,\n makeMultiCategoryClassifyErrorResult\n} from \"./multiCategoryClassifyResult\";\nimport { combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo } from \"./textAnalyticsResult\";\n\n/**\n * Array of `MultiCategoryClassifyResult` objects corresponding to a batch of input documents, and\n * annotated with information about the batch operation.\n */\nexport interface MultiCategoryClassifyResultArray extends Array<MultiCategoryClassifyResult> {\n /**\n * Statistics about the input document batch and how it was processed\n * by the service. This property will have a value when includeStatistics is set to true\n * in the client call.\n */\n statistics?: TextDocumentBatchStatistics;\n /**\n * The version of the text analytics custom project used by this operation on this\n * batch of input documents.\n */\n projectName: string;\n /**\n * The version of the text analytics custom deployment used by this operation on this\n * batch of input documents.\n */\n deploymentName: string;\n}\n\n/**\n * @internal\n */\nexport function makeMultiCategoryClassifyResultArray(\n input: TextDocumentInput[],\n response: CustomMultiClassificationResult\n): MultiCategoryClassifyResultArray {\n return combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo(\n input,\n response,\n makeMultiCategoryClassifyResult,\n makeMultiCategoryClassifyErrorResult\n );\n}\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=pollerModels.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pollerModels.js","sourceRoot":"","sources":["../../src/pollerModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { PollOperationState } from \"@azure/core-lro\";\nimport { State } from \"./generated/models\";\n\n/**\n * Metadata information for an analysis poller operation.\n */\nexport interface OperationMetadata {\n /**\n * The date and time the operation was created.\n */\n createdOn: Date;\n /**\n * The date and time when the operation results will expire on the server.\n */\n expiresOn?: Date;\n /**\n * The operation id.\n */\n operationId: string;\n /**\n * The time the operation status was last updated.\n */\n lastModifiedOn: Date;\n /**\n * The current status of the operation.\n */\n status: State;\n}\n\n/**\n * An interface representing the state of an analysis poller operation.\n */\nexport interface AnalysisPollOperationState<TResult>\n extends PollOperationState<TResult>,\n OperationMetadata {}\n"]}
@@ -1,17 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
4
- /**
5
- * @internal
6
- */
7
- export function makeRecognizeCategorizedEntitiesResult(result) {
8
- const { entities, statistics, warnings, id } = result;
9
- return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { entities });
10
- }
11
- /**
12
- * @internal
13
- */
14
- export function makeRecognizeCategorizedEntitiesErrorResult(id, error) {
15
- return makeTextAnalyticsErrorResult(id, error);
16
- }
17
- //# sourceMappingURL=recognizeCategorizedEntitiesResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recognizeCategorizedEntitiesResult.js","sourceRoot":"","sources":["../../src/recognizeCategorizedEntitiesResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;AAgC/B;;GAEG;AACH,MAAM,UAAU,sCAAsC,CACpD,MAAwB;IAExB,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;IACtD,uCACK,8BAA8B,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,KAC3D,QAAQ,IACR;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2CAA2C,CACzD,EAAU,EACV,KAAyB;IAEzB,OAAO,4BAA4B,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n makeTextAnalyticsSuccessResult,\n TextAnalyticsSuccessResult,\n TextAnalyticsErrorResult,\n makeTextAnalyticsErrorResult\n} from \"./textAnalyticsResult\";\nimport { Entity, TextAnalyticsError, DocumentEntities } from \"./generated/models\";\n\n/**\n * An entity from text analysis with information about its categorical\n * classification.\n */\nexport interface CategorizedEntity extends Entity {}\n\n/**\n * The result of the recognize entities operation on a single document.\n */\nexport type RecognizeCategorizedEntitiesResult =\n | RecognizeCategorizedEntitiesSuccessResult\n | RecognizeCategorizedEntitiesErrorResult;\n\n/**\n * The result of the recognize entities operation on a single document, containing the collection of\n * `Entity` objects identified in that document.\n */\nexport interface RecognizeCategorizedEntitiesSuccessResult extends TextAnalyticsSuccessResult {\n /**\n * The collection of entities identified in the input document.\n */\n readonly entities: CategorizedEntity[];\n}\n\n/**\n * An error result from the recognize entities operation on a single document.\n */\nexport type RecognizeCategorizedEntitiesErrorResult = TextAnalyticsErrorResult;\n\n/**\n * @internal\n */\nexport function makeRecognizeCategorizedEntitiesResult(\n result: DocumentEntities\n): RecognizeCategorizedEntitiesSuccessResult {\n const { entities, statistics, warnings, id } = result;\n return {\n ...makeTextAnalyticsSuccessResult(id, warnings, statistics),\n entities\n };\n}\n\n/**\n * @internal\n */\nexport function makeRecognizeCategorizedEntitiesErrorResult(\n id: string,\n error: TextAnalyticsError\n): RecognizeCategorizedEntitiesErrorResult {\n return makeTextAnalyticsErrorResult(id, error);\n}\n"]}
@@ -1,11 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeRecognizeCategorizedEntitiesResult, makeRecognizeCategorizedEntitiesErrorResult } from "./recognizeCategorizedEntitiesResult";
4
- import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from "./textAnalyticsResult";
5
- /**
6
- * @internal
7
- */
8
- export function makeRecognizeCategorizedEntitiesResultArray(input, response) {
9
- return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(input, response, makeRecognizeCategorizedEntitiesResult, makeRecognizeCategorizedEntitiesErrorResult);
10
- }
11
- //# sourceMappingURL=recognizeCategorizedEntitiesResultArray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recognizeCategorizedEntitiesResultArray.js","sourceRoot":"","sources":["../../src/recognizeCategorizedEntitiesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAEL,sCAAsC,EACtC,2CAA2C,EAC5C,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,mEAAmE,EAAE,MAAM,uBAAuB,CAAC;AAqB5G;;GAEG;AACH,MAAM,UAAU,2CAA2C,CACzD,KAA0B,EAC1B,QAAwB;IAExB,OAAO,mEAAmE,CACxE,KAAK,EACL,QAAQ,EACR,sCAAsC,EACtC,2CAA2C,CAC5C,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TextDocumentBatchStatistics, TextDocumentInput, EntitiesResult } from \"./generated/models\";\nimport {\n RecognizeCategorizedEntitiesResult,\n makeRecognizeCategorizedEntitiesResult,\n makeRecognizeCategorizedEntitiesErrorResult\n} from \"./recognizeCategorizedEntitiesResult\";\nimport { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from \"./textAnalyticsResult\";\n\n/**\n * Array of `RecognizeCategorizedEntitiesResult` objects corresponding to a batch of input documents, and\n * annotated with information about the batch operation.\n */\nexport interface RecognizeCategorizedEntitiesResultArray\n extends Array<RecognizeCategorizedEntitiesResult> {\n /**\n * Statistics about the input document batch and how it was processed\n * by the service. This property will have a value when includeStatistics is set to true\n * in the client call.\n */\n statistics?: TextDocumentBatchStatistics;\n /**\n * The version of the text analytics model used by this operation on this\n * batch of input documents.\n */\n modelVersion: string;\n}\n\n/**\n * @internal\n */\nexport function makeRecognizeCategorizedEntitiesResultArray(\n input: TextDocumentInput[],\n response: EntitiesResult\n): RecognizeCategorizedEntitiesResultArray {\n return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(\n input,\n response,\n makeRecognizeCategorizedEntitiesResult,\n makeRecognizeCategorizedEntitiesErrorResult\n );\n}\n"]}
@@ -1,17 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
4
- /**
5
- * @internal
6
- */
7
- export function makeRecognizeCustomEntitiesResult(result) {
8
- const { id, warnings, statistics, entities } = result;
9
- return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { entities });
10
- }
11
- /**
12
- * @internal
13
- */
14
- export function makeRecognizeCustomEntitiesErrorResult(id, error) {
15
- return makeTextAnalyticsErrorResult(id, error);
16
- }
17
- //# sourceMappingURL=recognizeCustomEntitiesResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recognizeCustomEntitiesResult.js","sourceRoot":"","sources":["../../src/recognizeCustomEntitiesResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;AA2B/B;;GAEG;AACH,MAAM,UAAU,iCAAiC,CAC/C,MAAwB;IAExB,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IACtD,uCACK,8BAA8B,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,KAC3D,QAAQ,IACR;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sCAAsC,CACpD,EAAU,EACV,KAAyB;IAEzB,OAAO,4BAA4B,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n makeTextAnalyticsSuccessResult,\n TextAnalyticsSuccessResult,\n TextAnalyticsErrorResult,\n makeTextAnalyticsErrorResult\n} from \"./textAnalyticsResult\";\nimport { TextAnalyticsError, DocumentEntities } from \"./generated/models\";\nimport { CategorizedEntity } from \"./recognizeCategorizedEntitiesResult\";\n\n/**\n * The result of the custom recognize entities operation on a single document.\n */\nexport type RecognizeCustomEntitiesResult =\n | RecognizeCustomEntitiesSuccessResult\n | RecognizeCustomEntitiesErrorResult;\n\n/**\n * The result of the recognize custom entities operation on a single document,\n * containing a collection of the entities identified in that document.\n */\nexport interface RecognizeCustomEntitiesSuccessResult extends TextAnalyticsSuccessResult {\n /**\n * The collection of entities identified in the input document.\n */\n entities: CategorizedEntity[];\n}\n\n/**\n * An error result from the recognize custom entities operation on a single document.\n */\nexport type RecognizeCustomEntitiesErrorResult = TextAnalyticsErrorResult;\n\n/**\n * @internal\n */\nexport function makeRecognizeCustomEntitiesResult(\n result: DocumentEntities\n): RecognizeCustomEntitiesSuccessResult {\n const { id, warnings, statistics, entities } = result;\n return {\n ...makeTextAnalyticsSuccessResult(id, warnings, statistics),\n entities\n };\n}\n\n/**\n * @internal\n */\nexport function makeRecognizeCustomEntitiesErrorResult(\n id: string,\n error: TextAnalyticsError\n): RecognizeCustomEntitiesErrorResult {\n return makeTextAnalyticsErrorResult(id, error);\n}\n"]}
@@ -1,11 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeRecognizeCustomEntitiesResult, makeRecognizeCustomEntitiesErrorResult } from "./recognizeCustomEntitiesResult";
4
- import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo } from "./textAnalyticsResult";
5
- /**
6
- * @internal
7
- */
8
- export function makeRecognizeCustomEntitiesResultArray(input, response) {
9
- return combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo(input, response, makeRecognizeCustomEntitiesResult, makeRecognizeCustomEntitiesErrorResult);
10
- }
11
- //# sourceMappingURL=recognizeCustomEntitiesResultArray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recognizeCustomEntitiesResultArray.js","sourceRoot":"","sources":["../../src/recognizeCustomEntitiesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,iCAAiC,EACjC,sCAAsC,EACvC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,wEAAwE,EAAE,MAAM,uBAAuB,CAAC;AAyBjH;;GAEG;AACH,MAAM,UAAU,sCAAsC,CACpD,KAA0B,EAC1B,QAA8B;IAE9B,OAAO,wEAAwE,CAC7E,KAAK,EACL,QAAQ,EACR,iCAAiC,EACjC,sCAAsC,CACvC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n TextDocumentBatchStatistics,\n TextDocumentInput,\n CustomEntitiesResult\n} from \"./generated/models\";\nimport {\n RecognizeCustomEntitiesResult,\n makeRecognizeCustomEntitiesResult,\n makeRecognizeCustomEntitiesErrorResult\n} from \"./recognizeCustomEntitiesResult\";\nimport { combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo } from \"./textAnalyticsResult\";\n\n/**\n * Array of `CustomRecognizeEntitiesResult` objects corresponding to a batch of input documents, and\n * annotated with information about the batch operation.\n */\nexport interface RecognizeCustomEntitiesResultArray extends Array<RecognizeCustomEntitiesResult> {\n /**\n * Statistics about the input document batch and how it was processed\n * by the service. This property will have a value when includeStatistics is set to true\n * in the client call.\n */\n statistics?: TextDocumentBatchStatistics;\n /**\n * The version of the text analytics custom project used by this operation on this\n * batch of input documents.\n */\n projectName: string;\n /**\n * The version of the text analytics custom deployment used by this operation on this\n * batch of input documents.\n */\n deploymentName: string;\n}\n\n/**\n * @internal\n */\nexport function makeRecognizeCustomEntitiesResultArray(\n input: TextDocumentInput[],\n response: CustomEntitiesResult\n): RecognizeCustomEntitiesResultArray {\n return combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo(\n input,\n response,\n makeRecognizeCustomEntitiesResult,\n makeRecognizeCustomEntitiesErrorResult\n );\n}\n"]}
@@ -1,17 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
4
- /**
5
- * @internal
6
- */
7
- export function makeRecognizeLinkedEntitiesResult(result) {
8
- const { statistics, id, warnings, entities } = result;
9
- return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { entities });
10
- }
11
- /**
12
- * @internal
13
- */
14
- export function makeRecognizeLinkedEntitiesErrorResult(id, error) {
15
- return makeTextAnalyticsErrorResult(id, error);
16
- }
17
- //# sourceMappingURL=recognizeLinkedEntitiesResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recognizeLinkedEntitiesResult.js","sourceRoot":"","sources":["../../src/recognizeLinkedEntitiesResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;AA0B/B;;GAEG;AACH,MAAM,UAAU,iCAAiC,CAC/C,MAA8B;IAE9B,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IACtD,uCACK,8BAA8B,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,KAC3D,QAAQ,IACR;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sCAAsC,CACpD,EAAU,EACV,KAAyB;IAEzB,OAAO,4BAA4B,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n makeTextAnalyticsSuccessResult,\n TextAnalyticsSuccessResult,\n TextAnalyticsErrorResult,\n makeTextAnalyticsErrorResult\n} from \"./textAnalyticsResult\";\nimport { TextAnalyticsError, LinkedEntity, DocumentLinkedEntities } from \"./generated/models\";\n\n/**\n * The result of the recognize linked entities operation on a single document.\n */\nexport type RecognizeLinkedEntitiesResult =\n | RecognizeLinkedEntitiesSuccessResult\n | RecognizeLinkedEntitiesErrorResult;\n\n/**\n * The result of the recognize linked entities operation on a single document,\n * containing a collection of the `LinkedEntity` objects identified in that document.\n */\nexport interface RecognizeLinkedEntitiesSuccessResult extends TextAnalyticsSuccessResult {\n /**\n * The collection of entities identified in the input document.\n */\n readonly entities: LinkedEntity[];\n}\n\n/**\n * An error result from the recognize linked entities operation on a single document.\n */\nexport type RecognizeLinkedEntitiesErrorResult = TextAnalyticsErrorResult;\n\n/**\n * @internal\n */\nexport function makeRecognizeLinkedEntitiesResult(\n result: DocumentLinkedEntities\n): RecognizeLinkedEntitiesSuccessResult {\n const { statistics, id, warnings, entities } = result;\n return {\n ...makeTextAnalyticsSuccessResult(id, warnings, statistics),\n entities\n };\n}\n\n/**\n * @internal\n */\nexport function makeRecognizeLinkedEntitiesErrorResult(\n id: string,\n error: TextAnalyticsError\n): RecognizeLinkedEntitiesErrorResult {\n return makeTextAnalyticsErrorResult(id, error);\n}\n"]}
@@ -1,11 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeRecognizeLinkedEntitiesResult, makeRecognizeLinkedEntitiesErrorResult } from "./recognizeLinkedEntitiesResult";
4
- import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from "./textAnalyticsResult";
5
- /**
6
- * @internal
7
- */
8
- export function makeRecognizeLinkedEntitiesResultArray(input, response) {
9
- return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(input, response, makeRecognizeLinkedEntitiesResult, makeRecognizeLinkedEntitiesErrorResult);
10
- }
11
- //# sourceMappingURL=recognizeLinkedEntitiesResultArray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recognizeLinkedEntitiesResultArray.js","sourceRoot":"","sources":["../../src/recognizeLinkedEntitiesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,iCAAiC,EACjC,sCAAsC,EACvC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,mEAAmE,EAAE,MAAM,uBAAuB,CAAC;AAoB5G;;GAEG;AACH,MAAM,UAAU,sCAAsC,CACpD,KAA0B,EAC1B,QAA6B;IAE7B,OAAO,mEAAmE,CACxE,KAAK,EACL,QAAQ,EACR,iCAAiC,EACjC,sCAAsC,CACvC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n TextDocumentBatchStatistics,\n TextDocumentInput,\n EntityLinkingResult\n} from \"./generated/models\";\nimport {\n RecognizeLinkedEntitiesResult,\n makeRecognizeLinkedEntitiesResult,\n makeRecognizeLinkedEntitiesErrorResult\n} from \"./recognizeLinkedEntitiesResult\";\nimport { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from \"./textAnalyticsResult\";\n\n/**\n * Array of `RecognizeLinkedEntitiesResult` objects corresponding to a batch of input documents, and\n * annotated with information about the batch operation.\n */\nexport interface RecognizeLinkedEntitiesResultArray extends Array<RecognizeLinkedEntitiesResult> {\n /**\n * Statistics about the input document batch and how it was processed\n * by the service. This property will have a value when includeStatistics is set to true\n * in the client call.\n */\n statistics?: TextDocumentBatchStatistics;\n /**\n * The version of the text analytics model used by this operation on this\n * batch of input documents.\n */\n modelVersion: string;\n}\n\n/**\n * @internal\n */\nexport function makeRecognizeLinkedEntitiesResultArray(\n input: TextDocumentInput[],\n response: EntityLinkingResult\n): RecognizeLinkedEntitiesResultArray {\n return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(\n input,\n response,\n makeRecognizeLinkedEntitiesResult,\n makeRecognizeLinkedEntitiesErrorResult\n );\n}\n"]}
@@ -1,18 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
4
- /**
5
- * @internal
6
- */
7
- export function makeRecognizePiiEntitiesResult(document) {
8
- const { id, entities, warnings, statistics, redactedText } = document;
9
- return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { entities,
10
- redactedText });
11
- }
12
- /**
13
- * @internal
14
- */
15
- export function makeRecognizePiiEntitiesErrorResult(id, error) {
16
- return makeTextAnalyticsErrorResult(id, error);
17
- }
18
- //# sourceMappingURL=recognizePiiEntitiesResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recognizePiiEntitiesResult.js","sourceRoot":"","sources":["../../src/recognizePiiEntitiesResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;AAoC/B;;GAEG;AACH,MAAM,UAAU,8BAA8B,CAC5C,QAA6B;IAE7B,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC;IACtE,uCACK,8BAA8B,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,KAC3D,QAAQ;QACR,YAAY,IACZ;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mCAAmC,CACjD,EAAU,EACV,KAAyB;IAEzB,OAAO,4BAA4B,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n makeTextAnalyticsSuccessResult,\n TextAnalyticsSuccessResult,\n TextAnalyticsErrorResult,\n makeTextAnalyticsErrorResult\n} from \"./textAnalyticsResult\";\nimport { Entity, PiiDocumentEntities, TextAnalyticsError } from \"./generated/models\";\n\n/**\n * An entity from PII recognition with information about the kind of PII\n * encountered.\n */\nexport interface PiiEntity extends Entity {}\n\n/**\n * The result of the recognize entities operation on a single document.\n */\nexport type RecognizePiiEntitiesResult =\n | RecognizePiiEntitiesSuccessResult\n | RecognizePiiEntitiesErrorResult;\n\n/**\n * The result of the recognize entities operation on a single document, containing the collection of\n * `Entity` objects identified in that document.\n */\nexport interface RecognizePiiEntitiesSuccessResult extends TextAnalyticsSuccessResult {\n /**\n * The collection of entities identified in the input document.\n */\n readonly entities: PiiEntity[];\n /**\n * The text redacted.\n */\n redactedText: string;\n}\n\n/**\n * An error result from the recognize entities operation on a single document.\n */\nexport type RecognizePiiEntitiesErrorResult = TextAnalyticsErrorResult;\n\n/**\n * @internal\n */\nexport function makeRecognizePiiEntitiesResult(\n document: PiiDocumentEntities\n): RecognizePiiEntitiesSuccessResult {\n const { id, entities, warnings, statistics, redactedText } = document;\n return {\n ...makeTextAnalyticsSuccessResult(id, warnings, statistics),\n entities,\n redactedText\n };\n}\n\n/**\n * @internal\n */\nexport function makeRecognizePiiEntitiesErrorResult(\n id: string,\n error: TextAnalyticsError\n): RecognizePiiEntitiesErrorResult {\n return makeTextAnalyticsErrorResult(id, error);\n}\n"]}
@@ -1,11 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { makeRecognizePiiEntitiesResult, makeRecognizePiiEntitiesErrorResult } from "./recognizePiiEntitiesResult";
4
- import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from "./textAnalyticsResult";
5
- /**
6
- * @internal
7
- */
8
- export function makeRecognizePiiEntitiesResultArray(input, response) {
9
- return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(input, response, makeRecognizePiiEntitiesResult, makeRecognizePiiEntitiesErrorResult);
10
- }
11
- //# sourceMappingURL=recognizePiiEntitiesResultArray.js.map