@azure/ai-text-analytics 5.2.0-alpha.20211201.2 → 5.2.0-alpha.20220107.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.
- package/dist/index.js +78 -76
- package/dist/index.js.map +1 -1
- package/dist-esm/src/analyzeActionsResult.js +15 -15
- package/dist-esm/src/analyzeActionsResult.js.map +1 -1
- package/dist-esm/src/analyzeHealthcareEntitiesResult.js +4 -4
- package/dist-esm/src/analyzeHealthcareEntitiesResult.js.map +1 -1
- package/dist-esm/src/analyzeLro.js +11 -11
- package/dist-esm/src/analyzeLro.js.map +1 -1
- package/dist-esm/src/analyzeSentimentResult.js +5 -5
- package/dist-esm/src/analyzeSentimentResult.js.map +1 -1
- package/dist-esm/src/analyzeSentimentResultArray.js +1 -1
- package/dist-esm/src/analyzeSentimentResultArray.js.map +1 -1
- package/dist-esm/src/azureKeyCredentialPolicy.js +1 -1
- package/dist-esm/src/azureKeyCredentialPolicy.js.map +1 -1
- package/dist-esm/src/detectLanguageResult.js +1 -1
- package/dist-esm/src/detectLanguageResult.js.map +1 -1
- package/dist-esm/src/detectLanguageResultArray.js +1 -1
- package/dist-esm/src/detectLanguageResultArray.js.map +1 -1
- package/dist-esm/src/extractKeyPhrasesResult.js +1 -1
- package/dist-esm/src/extractKeyPhrasesResult.js.map +1 -1
- package/dist-esm/src/extractKeyPhrasesResultArray.js +1 -1
- package/dist-esm/src/extractKeyPhrasesResultArray.js.map +1 -1
- package/dist-esm/src/extractSummaryResult.js +1 -1
- package/dist-esm/src/extractSummaryResult.js.map +1 -1
- package/dist-esm/src/extractSummaryResultArray.js +1 -1
- package/dist-esm/src/extractSummaryResultArray.js.map +1 -1
- package/dist-esm/src/healthLro.js +12 -12
- package/dist-esm/src/healthLro.js.map +1 -1
- package/dist-esm/src/index.js +2 -4
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/multiCategoryClassifyResult.js +1 -1
- package/dist-esm/src/multiCategoryClassifyResult.js.map +1 -1
- package/dist-esm/src/multiCategoryClassifyResultArray.js +1 -1
- package/dist-esm/src/multiCategoryClassifyResultArray.js.map +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResult.js +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/recognizeCustomEntitiesResult.js +1 -1
- package/dist-esm/src/recognizeCustomEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizeCustomEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizeCustomEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResult.js +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/recognizePiiEntitiesResult.js +1 -1
- package/dist-esm/src/recognizePiiEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizePiiEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizePiiEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/singleCategoryClassifyResult.js +1 -1
- package/dist-esm/src/singleCategoryClassifyResult.js.map +1 -1
- package/dist-esm/src/singleCategoryClassifyResultArray.js +1 -1
- package/dist-esm/src/singleCategoryClassifyResultArray.js.map +1 -1
- package/dist-esm/src/textAnalyticsClient.js +41 -41
- package/dist-esm/src/textAnalyticsClient.js.map +1 -1
- package/dist-esm/src/textAnalyticsResult.js +5 -5
- package/dist-esm/src/textAnalyticsResult.js.map +1 -1
- package/dist-esm/src/tracing.js +1 -1
- package/dist-esm/src/tracing.js.map +1 -1
- package/dist-esm/src/util.js +9 -6
- package/dist-esm/src/util.js.map +1 -1
- package/package.json +7 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeExtractKeyPhrasesResult, makeExtractKeyPhrasesErrorResult } from "./extractKeyPhrasesResult";
|
|
3
|
+
import { makeExtractKeyPhrasesResult, makeExtractKeyPhrasesErrorResult, } from "./extractKeyPhrasesResult";
|
|
4
4
|
import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from "./textAnalyticsResult";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractKeyPhrasesResultArray.js","sourceRoot":"","sources":["../../src/extractKeyPhrasesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,2BAA2B,EAC3B,gCAAgC,
|
|
1
|
+
{"version":3,"file":"extractKeyPhrasesResultArray.js","sourceRoot":"","sources":["../../src/extractKeyPhrasesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,2BAA2B,EAC3B,gCAAgC,GACjC,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,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
|
|
3
|
+
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult, } from "./textAnalyticsResult";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractSummaryResult.js","sourceRoot":"","sources":["../../src/extractSummaryResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"extractSummaryResult.js","sourceRoot":"","sources":["../../src/extractSummaryResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,GAC7B,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,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeExtractSummaryResult, makeExtractSummaryErrorResult } from "./extractSummaryResult";
|
|
3
|
+
import { makeExtractSummaryResult, makeExtractSummaryErrorResult, } from "./extractSummaryResult";
|
|
4
4
|
import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from "./textAnalyticsResult";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractSummaryResultArray.js","sourceRoot":"","sources":["../../src/extractSummaryResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,wBAAwB,EACxB,6BAA6B,
|
|
1
|
+
{"version":3,"file":"extractSummaryResultArray.js","sourceRoot":"","sources":["../../src/extractSummaryResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,wBAAwB,EACxB,6BAA6B,GAC9B,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"]}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
import { SpanStatusCode } from "@azure/core-tracing";
|
|
4
4
|
import { createSerializer } from "@azure/core-client";
|
|
5
|
-
import { makeHealthcareEntitiesErrorResult, makeHealthcareEntitiesResult } from "./analyzeHealthcareEntitiesResult";
|
|
5
|
+
import { makeHealthcareEntitiesErrorResult, makeHealthcareEntitiesResult, } from "./analyzeHealthcareEntitiesResult";
|
|
6
6
|
import { createSpan } from "./tracing";
|
|
7
|
-
import { addStrEncodingParam, getRawResponse, compileError, sendGetRequest } from "./util";
|
|
7
|
+
import { addStrEncodingParam, getRawResponse, compileError, sendGetRequest, } from "./util";
|
|
8
8
|
import * as Mappers from "./generated/models/mappers";
|
|
9
|
-
import { accept, apiVersion, endpoint, includeStatistics, skip, top } from "./generated/models/parameters";
|
|
9
|
+
import { accept, apiVersion, endpoint, includeStatistics, skip, top, } from "./generated/models/parameters";
|
|
10
10
|
import { processAndCombineSuccessfulAndErroneousDocuments } from "./textAnalyticsResult";
|
|
11
11
|
import { getPagedAsyncIterator } from "@azure/core-paging";
|
|
12
12
|
const serializer = createSerializer(Mappers, /* isXml */ false);
|
|
@@ -16,16 +16,16 @@ const healthStatusOperationSpec = {
|
|
|
16
16
|
httpMethod: "GET",
|
|
17
17
|
responses: {
|
|
18
18
|
200: {
|
|
19
|
-
bodyMapper: Mappers.HealthcareJobState
|
|
19
|
+
bodyMapper: Mappers.HealthcareJobState,
|
|
20
20
|
},
|
|
21
21
|
default: {
|
|
22
|
-
bodyMapper: Mappers.ErrorResponse
|
|
23
|
-
}
|
|
22
|
+
bodyMapper: Mappers.ErrorResponse,
|
|
23
|
+
},
|
|
24
24
|
},
|
|
25
25
|
queryParameters: [includeStatistics, top, skip],
|
|
26
26
|
urlParameters: [endpoint, apiVersion],
|
|
27
27
|
headerParameters: [accept],
|
|
28
|
-
serializer
|
|
28
|
+
serializer,
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* @internal
|
|
@@ -48,14 +48,14 @@ export class HealthLro {
|
|
|
48
48
|
const { flatResponse, rawResponse } = await getRawResponse((paramOptions) => this.client.health({ documents: this.documents }, paramOptions), finalOptions);
|
|
49
49
|
return {
|
|
50
50
|
flatResponse: flatResponse,
|
|
51
|
-
rawResponse
|
|
51
|
+
rawResponse,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
catch (e) {
|
|
55
55
|
const exception = compileError(e);
|
|
56
56
|
span.setStatus({
|
|
57
57
|
code: SpanStatusCode.ERROR,
|
|
58
|
-
message: exception.message
|
|
58
|
+
message: exception.message,
|
|
59
59
|
});
|
|
60
60
|
throw exception;
|
|
61
61
|
}
|
|
@@ -111,18 +111,18 @@ client, documents, options) {
|
|
|
111
111
|
if (flatResponse.results) {
|
|
112
112
|
return {
|
|
113
113
|
page: processAndCombineSuccessfulAndErroneousDocuments(documents, flatResponse.results, makeHealthcareEntitiesResult, makeHealthcareEntitiesErrorResult),
|
|
114
|
-
nextPageLink: flatResponse.nextLink
|
|
114
|
+
nextPageLink: flatResponse.nextLink,
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
else {
|
|
118
118
|
throw new Error("Healthcare action has succeeded but there are no results!");
|
|
119
119
|
}
|
|
120
|
-
}
|
|
120
|
+
},
|
|
121
121
|
};
|
|
122
122
|
const pagedIterator = getPagedAsyncIterator(pagedResult);
|
|
123
123
|
return Object.assign(pagedIterator, {
|
|
124
124
|
statistics: result.results.statistics,
|
|
125
|
-
modelVersion: result.results.modelVersion
|
|
125
|
+
modelVersion: result.results.modelVersion,
|
|
126
126
|
});
|
|
127
127
|
};
|
|
128
128
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"healthLro.js","sourceRoot":"","sources":["../../src/healthLro.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAmC,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAGL,iCAAiC,EACjC,4BAA4B,EAE7B,MAAM,mCAAmC,CAAC;AAO3C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,cAAc,EAEf,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,EACL,MAAM,EACN,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,IAAI,EACJ,GAAG,EACJ,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gDAAgD,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAe,MAAM,oBAAoB,CAAC;AAoCxE,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAEhE,wDAAwD;AACx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3C,KAAK,CAAC,cAAc,GAAG,QAAQ,CAAC,kBAAkB,CAAC;IACnD,KAAK,CAAC,SAAS,GAAG,QAAQ,CAAC,kBAAkB,CAAC;IAC9C,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AACjC,CAAC","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
|
+
{"version":3,"file":"healthLro.js","sourceRoot":"","sources":["../../src/healthLro.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAmC,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAGL,iCAAiC,EACjC,4BAA4B,GAE7B,MAAM,mCAAmC,CAAC;AAO3C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,cAAc,GAEf,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,EACL,MAAM,EACN,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,IAAI,EACJ,GAAG,GACJ,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gDAAgD,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAe,MAAM,oBAAoB,CAAC;AAoCxE,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,EAAE,WAAW,CA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SAAS,GAAG,QAAQ,CAAC,eAAe,CAAC;IAC3C,KAAK,CAAC,cAAc,GAAG,QAAQ,CAAC,kBAAkB,CAAC;IACnD,KAAK,CAAC,SAAS,GAAG,QAAQ,CAAC,kBAAkB,CAAC;IAC9C,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AACjC,CAAC","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"]}
|
package/dist-esm/src/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
/// <reference lib="esnext.asynciterable" />
|
|
4
|
-
import "@azure/core-asynciterator-polyfill";
|
|
5
3
|
export { AzureKeyCredential } from "@azure/core-auth";
|
|
6
|
-
export { TextAnalyticsClient, PiiEntityDomain } from "./textAnalyticsClient";
|
|
4
|
+
export { TextAnalyticsClient, PiiEntityDomain, } from "./textAnalyticsClient";
|
|
7
5
|
// Models
|
|
8
|
-
export { KnownInnerErrorCodeValue, KnownWarningCode, KnownHealthcareEntityCategory } from "./generated/models";
|
|
6
|
+
export { KnownInnerErrorCodeValue, KnownWarningCode, KnownHealthcareEntityCategory, } from "./generated/models";
|
|
9
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EACL,mBAAmB,EAQnB,eAAe,GAsBhB,MAAM,uBAAuB,CAAC;AA+H/B,SAAS;AACT,OAAO,EAYL,wBAAwB,EAExB,gBAAgB,EAchB,6BAA6B,GAG9B,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { AzureKeyCredential } from \"@azure/core-auth\";\n\nexport {\n TextAnalyticsClient,\n TextAnalyticsClientOptions,\n DetectLanguageOptions,\n RecognizeCategorizedEntitiesOptions,\n AnalyzeSentimentOptions,\n ExtractKeyPhrasesOptions,\n RecognizePiiEntitiesOptions,\n RecognizeLinkedEntitiesOptions,\n PiiEntityDomain,\n TextAnalyticsActions,\n RecognizeCategorizedEntitiesAction,\n RecognizePiiEntitiesAction,\n ExtractKeyPhrasesAction,\n BeginAnalyzeActionsOptions,\n AnalyzeActionsPollerLike,\n BeginAnalyzeHealthcareEntitiesOptions,\n AnalyzeHealthcareEntitiesPollerLike,\n AnalyzeActionsOperationState,\n AnalyzeHealthcareOperationState,\n AnalysisPollOperationState,\n OperationMetadata,\n AnalyzeActionsOperationMetadata,\n StringIndexType,\n RecognizeLinkedEntitiesAction,\n AnalyzeSentimentAction,\n ExtractSummaryAction,\n KnownSummarySentencesSortBy as KnownSummarySentencesOrderBy,\n RecognizeCustomEntitiesAction,\n SingleCategoryClassifyAction,\n MultiCategoryClassifyAction,\n} from \"./textAnalyticsClient\";\nexport { TextAnalyticsOperationOptions } from \"./textAnalyticsOperationOptions\";\nexport {\n DetectLanguageResult,\n DetectLanguageErrorResult,\n DetectLanguageSuccessResult,\n} from \"./detectLanguageResult\";\nexport { DetectLanguageResultArray } from \"./detectLanguageResultArray\";\nexport {\n CategorizedEntity,\n RecognizeCategorizedEntitiesResult,\n RecognizeCategorizedEntitiesErrorResult,\n RecognizeCategorizedEntitiesSuccessResult,\n} from \"./recognizeCategorizedEntitiesResult\";\nexport {\n PiiEntity,\n RecognizePiiEntitiesResult,\n RecognizePiiEntitiesErrorResult,\n RecognizePiiEntitiesSuccessResult,\n} from \"./recognizePiiEntitiesResult\";\nexport { RecognizePiiEntitiesResultArray } from \"./recognizePiiEntitiesResultArray\";\nexport { RecognizeCategorizedEntitiesResultArray } from \"./recognizeCategorizedEntitiesResultArray\";\nexport {\n AnalyzeSentimentResult,\n AnalyzeSentimentErrorResult,\n AnalyzeSentimentSuccessResult,\n SentenceSentiment,\n Opinion,\n TargetSentiment,\n AssessmentSentiment,\n} from \"./analyzeSentimentResult\";\nexport { AnalyzeSentimentResultArray } from \"./analyzeSentimentResultArray\";\nexport {\n ExtractKeyPhrasesResult,\n ExtractKeyPhrasesErrorResult,\n ExtractKeyPhrasesSuccessResult,\n} from \"./extractKeyPhrasesResult\";\nexport { ExtractKeyPhrasesResultArray } from \"./extractKeyPhrasesResultArray\";\nexport {\n ExtractSummaryResult,\n ExtractSummaryErrorResult,\n ExtractSummarySuccessResult,\n SummarySentence,\n} from \"./extractSummaryResult\";\nexport { ExtractSummaryResultArray } from \"./extractSummaryResultArray\";\nexport {\n RecognizeCustomEntitiesErrorResult,\n RecognizeCustomEntitiesResult,\n RecognizeCustomEntitiesSuccessResult,\n} from \"./recognizeCustomEntitiesResult\";\nexport { RecognizeCustomEntitiesResultArray } from \"./recognizeCustomEntitiesResultArray\";\nexport {\n SingleCategoryClassifyErrorResult,\n SingleCategoryClassifyResult,\n SingleCategoryClassifySuccessResult,\n ClassificationCategory,\n} from \"./singleCategoryClassifyResult\";\nexport { SingleCategoryClassifyResultArray } from \"./singleCategoryClassifyResultArray\";\nexport {\n MultiCategoryClassifyErrorResult,\n MultiCategoryClassifyResult,\n MultiCategoryClassifySuccessResult,\n} from \"./multiCategoryClassifyResult\";\nexport { MultiCategoryClassifyResultArray } from \"./multiCategoryClassifyResultArray\";\nexport {\n RecognizeLinkedEntitiesResult,\n RecognizeLinkedEntitiesErrorResult,\n RecognizeLinkedEntitiesSuccessResult,\n} from \"./recognizeLinkedEntitiesResult\";\nexport { RecognizeLinkedEntitiesResultArray } from \"./recognizeLinkedEntitiesResultArray\";\nexport {\n PagedAnalyzeHealthcareEntitiesResult,\n PagedAsyncIterableAnalyzeHealthcareEntitiesResult,\n AnalyzeHealthcareEntitiesResultArray,\n AnalyzeHealthcareEntitiesResult,\n AnalyzeHealthcareEntitiesSuccessResult,\n AnalyzeHealthcareEntitiesErrorResult,\n HealthcareEntity,\n EntityDataSource,\n HealthcareEntityRelation,\n HealthcareEntityRelationRole,\n HealthcareEntityRelationRoleType,\n} from \"./analyzeHealthcareEntitiesResult\";\nexport {\n PagedAnalyzeActionsResult,\n PagedAsyncIterableAnalyzeActionsResult,\n AnalyzeActionsResult,\n RecognizeCategorizedEntitiesActionResult,\n RecognizePiiEntitiesActionResult,\n ExtractKeyPhrasesActionResult,\n TextAnalyticsActionState,\n TextAnalyticsActionSuccessState,\n TextAnalyticsActionErrorResult,\n RecognizeCategorizedEntitiesActionErrorResult,\n RecognizeCategorizedEntitiesActionSuccessResult,\n RecognizePiiEntitiesActionErrorResult,\n RecognizePiiEntitiesActionSuccessResult,\n ExtractKeyPhrasesActionErrorResult,\n ExtractKeyPhrasesActionSuccessResult,\n RecognizeLinkedEntitiesActionResult,\n RecognizeLinkedEntitiesActionSuccessResult,\n RecognizeLinkedEntitiesActionErrorResult,\n AnalyzeSentimentActionErrorResult,\n AnalyzeSentimentActionResult,\n AnalyzeSentimentActionSuccessResult,\n ExtractSummaryActionResult,\n ExtractSummaryActionSuccessResult,\n ExtractSummaryActionErrorResult,\n RecognizeCustomEntitiesActionResult,\n RecongizeCustomEntitiesActionErrorResult,\n RecongizeCustomEntitiesActionSuccessResult,\n MultiCategoryClassifyActionErrorResult,\n MultiCategoryClassifyActionResult,\n MultiCategoryClassifyActionSuccessResult,\n SingleCategoryClassifyActionErrorResult,\n SingleCategoryClassifyActionResult,\n SingleCategoryClassifyActionSuccessResult,\n} from \"./analyzeActionsResult\";\nexport {\n ErrorCode,\n TextAnalyticsError,\n TextAnalyticsErrorResult,\n TextAnalyticsSuccessResult,\n} from \"./textAnalyticsResult\";\n\nexport { TextAnalyticsAction, CustomTextAnalyticsAction } from \"./textAnalyticsAction\";\n\n// Models\nexport {\n DetectedLanguage,\n TextDocumentStatistics,\n SentimentConfidenceScores,\n TextDocumentInput,\n DetectLanguageInput,\n TextDocumentBatchStatistics,\n Entity,\n DocumentSentimentLabel,\n SentenceSentimentLabel,\n ErrorCodeValue,\n InnerErrorCodeValue,\n KnownInnerErrorCodeValue,\n WarningCode,\n KnownWarningCode,\n LinkedEntity,\n Match,\n SentenceAssessment,\n TargetConfidenceScoreLabel,\n TokenSentimentValue,\n TextAnalyticsWarning,\n State as TextAnalyticsOperationStatus,\n HealthcareAssertion as EntityAssertion,\n PiiCategory as PiiEntityCategory,\n Association as EntityAssociation,\n Certainty as EntityCertainty,\n Conditionality as EntityConditionality,\n RelationType as HealthcareEntityRelationType,\n KnownHealthcareEntityCategory,\n HealthcareEntityCategory,\n ClassificationResult,\n} from \"./generated/models\";\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
|
|
3
|
+
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult, } from "./textAnalyticsResult";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiCategoryClassifyResult.js","sourceRoot":"","sources":["../../src/multiCategoryClassifyResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"multiCategoryClassifyResult.js","sourceRoot":"","sources":["../../src/multiCategoryClassifyResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,GAC7B,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,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeMultiCategoryClassifyResult, makeMultiCategoryClassifyErrorResult } from "./multiCategoryClassifyResult";
|
|
3
|
+
import { makeMultiCategoryClassifyResult, makeMultiCategoryClassifyErrorResult, } from "./multiCategoryClassifyResult";
|
|
4
4
|
import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo } from "./textAnalyticsResult";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,GACrC,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,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
|
|
3
|
+
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult, } from "./textAnalyticsResult";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeCategorizedEntitiesResult.js","sourceRoot":"","sources":["../../src/recognizeCategorizedEntitiesResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"recognizeCategorizedEntitiesResult.js","sourceRoot":"","sources":["../../src/recognizeCategorizedEntitiesResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,GAC7B,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,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeRecognizeCategorizedEntitiesResult, makeRecognizeCategorizedEntitiesErrorResult } from "./recognizeCategorizedEntitiesResult";
|
|
3
|
+
import { makeRecognizeCategorizedEntitiesResult, makeRecognizeCategorizedEntitiesErrorResult, } from "./recognizeCategorizedEntitiesResult";
|
|
4
4
|
import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from "./textAnalyticsResult";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeCategorizedEntitiesResultArray.js","sourceRoot":"","sources":["../../src/recognizeCategorizedEntitiesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAEL,sCAAsC,EACtC,2CAA2C,
|
|
1
|
+
{"version":3,"file":"recognizeCategorizedEntitiesResultArray.js","sourceRoot":"","sources":["../../src/recognizeCategorizedEntitiesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAEL,sCAAsC,EACtC,2CAA2C,GAC5C,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,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
|
|
3
|
+
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult, } from "./textAnalyticsResult";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeCustomEntitiesResult.js","sourceRoot":"","sources":["../../src/recognizeCustomEntitiesResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"recognizeCustomEntitiesResult.js","sourceRoot":"","sources":["../../src/recognizeCustomEntitiesResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,GAC7B,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,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeRecognizeCustomEntitiesResult, makeRecognizeCustomEntitiesErrorResult } from "./recognizeCustomEntitiesResult";
|
|
3
|
+
import { makeRecognizeCustomEntitiesResult, makeRecognizeCustomEntitiesErrorResult, } from "./recognizeCustomEntitiesResult";
|
|
4
4
|
import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo } from "./textAnalyticsResult";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeCustomEntitiesResultArray.js","sourceRoot":"","sources":["../../src/recognizeCustomEntitiesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,iCAAiC,EACjC,sCAAsC,
|
|
1
|
+
{"version":3,"file":"recognizeCustomEntitiesResultArray.js","sourceRoot":"","sources":["../../src/recognizeCustomEntitiesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,iCAAiC,EACjC,sCAAsC,GACvC,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,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
|
|
3
|
+
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult, } from "./textAnalyticsResult";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeLinkedEntitiesResult.js","sourceRoot":"","sources":["../../src/recognizeLinkedEntitiesResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"recognizeLinkedEntitiesResult.js","sourceRoot":"","sources":["../../src/recognizeLinkedEntitiesResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,GAC7B,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,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeRecognizeLinkedEntitiesResult, makeRecognizeLinkedEntitiesErrorResult } from "./recognizeLinkedEntitiesResult";
|
|
3
|
+
import { makeRecognizeLinkedEntitiesResult, makeRecognizeLinkedEntitiesErrorResult, } from "./recognizeLinkedEntitiesResult";
|
|
4
4
|
import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from "./textAnalyticsResult";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeLinkedEntitiesResultArray.js","sourceRoot":"","sources":["../../src/recognizeLinkedEntitiesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,iCAAiC,EACjC,sCAAsC,
|
|
1
|
+
{"version":3,"file":"recognizeLinkedEntitiesResultArray.js","sourceRoot":"","sources":["../../src/recognizeLinkedEntitiesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,iCAAiC,EACjC,sCAAsC,GACvC,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,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
|
|
3
|
+
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult, } from "./textAnalyticsResult";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizePiiEntitiesResult.js","sourceRoot":"","sources":["../../src/recognizePiiEntitiesResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"recognizePiiEntitiesResult.js","sourceRoot":"","sources":["../../src/recognizePiiEntitiesResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,GAC7B,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,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeRecognizePiiEntitiesResult, makeRecognizePiiEntitiesErrorResult } from "./recognizePiiEntitiesResult";
|
|
3
|
+
import { makeRecognizePiiEntitiesResult, makeRecognizePiiEntitiesErrorResult, } from "./recognizePiiEntitiesResult";
|
|
4
4
|
import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from "./textAnalyticsResult";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizePiiEntitiesResultArray.js","sourceRoot":"","sources":["../../src/recognizePiiEntitiesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAEL,8BAA8B,EAC9B,mCAAmC,
|
|
1
|
+
{"version":3,"file":"recognizePiiEntitiesResultArray.js","sourceRoot":"","sources":["../../src/recognizePiiEntitiesResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAEL,8BAA8B,EAC9B,mCAAmC,GACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,mEAAmE,EAAE,MAAM,uBAAuB,CAAC;AAoB5G;;GAEG;AACH,MAAM,UAAU,mCAAmC,CACjD,KAA0B,EAC1B,QAAmB;IAEnB,OAAO,mEAAmE,CACxE,KAAK,EACL,QAAQ,EACR,8BAA8B,EAC9B,mCAAmC,CACpC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TextDocumentBatchStatistics, TextDocumentInput, PiiResult } from \"./generated/models\";\nimport {\n RecognizePiiEntitiesResult,\n makeRecognizePiiEntitiesResult,\n makeRecognizePiiEntitiesErrorResult,\n} from \"./recognizePiiEntitiesResult\";\nimport { combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion } from \"./textAnalyticsResult\";\n\n/**\n * Collection of `RecognizePiiEntitiesResult` objects corresponding to a batch of input documents, and\n * annotated with information about the batch operation.\n */\nexport interface RecognizePiiEntitiesResultArray extends Array<RecognizePiiEntitiesResult> {\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 makeRecognizePiiEntitiesResultArray(\n input: TextDocumentInput[],\n response: PiiResult\n): RecognizePiiEntitiesResultArray {\n return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(\n input,\n response,\n makeRecognizePiiEntitiesResult,\n makeRecognizePiiEntitiesErrorResult\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
|
|
3
|
+
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult, } from "./textAnalyticsResult";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleCategoryClassifyResult.js","sourceRoot":"","sources":["../../src/singleCategoryClassifyResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"singleCategoryClassifyResult.js","sourceRoot":"","sources":["../../src/singleCategoryClassifyResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAmC/B;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAC9C,MAAoC;IAEpC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;IAC5D,uCACK,8BAA8B,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,KAC3D,cAAc,IACd;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qCAAqC,CACnD,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 ClassificationResult,\n SingleClassificationDocument,\n} from \"./generated/models\";\n\n/**\n * The result of the custom classify document single category operation on a single document.\n */\nexport type SingleCategoryClassifyResult =\n | SingleCategoryClassifySuccessResult\n | SingleCategoryClassifyErrorResult;\n\n/**\n * The result of the custom classify document single category operation on a single document,\n * containing the result of the classification.\n */\nexport interface SingleCategoryClassifySuccessResult extends TextAnalyticsSuccessResult {\n /**\n * The classification result of the input document.\n */\n classification: ClassificationCategory;\n}\n\n/**\n * A classification result from a custom classify document single category action\n */\nexport interface ClassificationCategory extends ClassificationResult {}\n\n/**\n * An error result from the custom classify document single category operation on a single document.\n */\nexport type SingleCategoryClassifyErrorResult = TextAnalyticsErrorResult;\n\n/**\n * @internal\n */\nexport function makeSingleCategoryClassifyResult(\n result: SingleClassificationDocument\n): SingleCategoryClassifySuccessResult {\n const { id, warnings, statistics, classification } = result;\n return {\n ...makeTextAnalyticsSuccessResult(id, warnings, statistics),\n classification,\n };\n}\n\n/**\n * @internal\n */\nexport function makeSingleCategoryClassifyErrorResult(\n id: string,\n error: TextAnalyticsError\n): SingleCategoryClassifyErrorResult {\n return makeTextAnalyticsErrorResult(id, error);\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import { makeSingleCategoryClassifyResult, makeSingleCategoryClassifyErrorResult } from "./singleCategoryClassifyResult";
|
|
3
|
+
import { makeSingleCategoryClassifyResult, makeSingleCategoryClassifyErrorResult, } from "./singleCategoryClassifyResult";
|
|
4
4
|
import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo } from "./textAnalyticsResult";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleCategoryClassifyResultArray.js","sourceRoot":"","sources":["../../src/singleCategoryClassifyResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,gCAAgC,EAChC,qCAAqC,
|
|
1
|
+
{"version":3,"file":"singleCategoryClassifyResultArray.js","sourceRoot":"","sources":["../../src/singleCategoryClassifyResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,gCAAgC,EAChC,qCAAqC,GACtC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,wEAAwE,EAAE,MAAM,uBAAuB,CAAC;AAyBjH;;GAEG;AACH,MAAM,UAAU,qCAAqC,CACnD,KAA0B,EAC1B,QAA0C;IAE1C,OAAO,wEAAwE,CAC7E,KAAK,EACL,QAAQ,EACR,gCAAgC,EAChC,qCAAqC,CACtC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n TextDocumentBatchStatistics,\n TextDocumentInput,\n CustomSingleClassificationResult,\n} from \"./generated/models\";\nimport {\n SingleCategoryClassifyResult,\n makeSingleCategoryClassifyResult,\n makeSingleCategoryClassifyErrorResult,\n} from \"./singleCategoryClassifyResult\";\nimport { combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo } from \"./textAnalyticsResult\";\n\n/**\n * Array of `SingleCategoryClassifyResult` objects corresponding to a batch of input documents, and\n * annotated with information about the batch operation.\n */\nexport interface SingleCategoryClassifyResultArray extends Array<SingleCategoryClassifyResult> {\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 makeSingleCategoryClassifyResultArray(\n input: TextDocumentInput[],\n response: CustomSingleClassificationResult\n): SingleCategoryClassifyResultArray {\n return combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo(\n input,\n response,\n makeSingleCategoryClassifyResult,\n makeSingleCategoryClassifyErrorResult\n );\n}\n"]}
|