@azure/ai-text-analytics 5.2.0-alpha.20211026.2 → 5.2.0-alpha.20211103.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/CHANGELOG.md +20 -1
- package/README.md +3 -1
- package/dist/index.js +917 -161
- package/dist/index.js.map +1 -1
- package/dist-esm/src/analyzeActionsResult.js +48 -10
- package/dist-esm/src/analyzeActionsResult.js.map +1 -1
- package/dist-esm/src/analyzeLro.js +2 -2
- package/dist-esm/src/analyzeLro.js.map +1 -1
- package/dist-esm/src/generated/generatedClientContext.js +2 -2
- package/dist-esm/src/generated/generatedClientContext.js.map +1 -1
- package/dist-esm/src/generated/models/index.js.map +1 -1
- package/dist-esm/src/generated/models/mappers.js +620 -1
- package/dist-esm/src/generated/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/models/parameters.js +2 -1
- package/dist-esm/src/generated/models/parameters.js.map +1 -1
- package/dist-esm/src/healthLro.js +2 -2
- package/dist-esm/src/healthLro.js.map +1 -1
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/multiCategoryClassifyResult.js +17 -0
- package/dist-esm/src/multiCategoryClassifyResult.js.map +1 -0
- package/dist-esm/src/multiCategoryClassifyResultArray.js +11 -0
- package/dist-esm/src/multiCategoryClassifyResultArray.js.map +1 -0
- package/dist-esm/src/recognizeCustomEntitiesResult.js +17 -0
- package/dist-esm/src/recognizeCustomEntitiesResult.js.map +1 -0
- package/dist-esm/src/recognizeCustomEntitiesResultArray.js +11 -0
- package/dist-esm/src/recognizeCustomEntitiesResultArray.js.map +1 -0
- package/dist-esm/src/singleCategoryClassifyResult.js +17 -0
- package/dist-esm/src/singleCategoryClassifyResult.js.map +1 -0
- package/dist-esm/src/singleCategoryClassifyResultArray.js +11 -0
- package/dist-esm/src/singleCategoryClassifyResultArray.js.map +1 -0
- package/dist-esm/src/textAnalyticsAction.js.map +1 -1
- package/dist-esm/src/textAnalyticsClient.js +7 -19
- package/dist-esm/src/textAnalyticsClient.js.map +1 -1
- package/dist-esm/src/textAnalyticsResult.js +16 -0
- package/dist-esm/src/textAnalyticsResult.js.map +1 -1
- package/dist-esm/src/util.js +28 -18
- package/dist-esm/src/util.js.map +1 -1
- package/package.json +2 -2
- package/types/ai-text-analytics.d.ts +318 -11
|
@@ -46,7 +46,7 @@ export const endpoint = {
|
|
|
46
46
|
export const apiVersion = {
|
|
47
47
|
parameterPath: "apiVersion",
|
|
48
48
|
mapper: {
|
|
49
|
-
defaultValue: "v3.2-preview.
|
|
49
|
+
defaultValue: "v3.2-preview.2",
|
|
50
50
|
isConstant: true,
|
|
51
51
|
serializedName: "ApiVersion",
|
|
52
52
|
type: {
|
|
@@ -91,6 +91,7 @@ export const top = {
|
|
|
91
91
|
export const skip = {
|
|
92
92
|
parameterPath: ["options", "skip"],
|
|
93
93
|
mapper: {
|
|
94
|
+
defaultValue: 0,
|
|
94
95
|
constraints: {
|
|
95
96
|
InclusiveMinimum: 0
|
|
96
97
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../src/generated/models/parameters.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EACL,iBAAiB,IAAI,uBAAuB,EAC5C,uBAAuB,IAAI,6BAA6B,EACxD,kBAAkB,IAAI,wBAAwB,EAC/C,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,WAAW,GAAuB;IAC7C,aAAa,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC;IACzC,MAAM,EAAE;QACN,YAAY,EAAE,kBAAkB;QAChC,UAAU,EAAE,IAAI;QAChB,cAAc,EAAE,cAAc;QAC9B,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAuB;IACtC,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;IAClC,MAAM,EAAE,uBAAuB;CACh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;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAA4B;IAC7C,aAAa,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACpC,MAAM,EAAE;QACN,cAAc,EAAE,QAAQ;QACxB,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAA4B;IACpD,aAAa,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC;IAC3C,MAAM,EAAE;QACN,WAAW,EAAE;YACX,WAAW,EAAE,IAAI;SAClB;QACD,cAAc,EAAE,eAAe;QAC/B,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE;gBACP,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;KACF;IACD,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAuB;IACxC,aAAa,EAAE,OAAO;IACtB,MAAM,EAAE,wBAAwB;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAA4B;IACpD,aAAa,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC;IAC3C,MAAM,EAAE;QACN,cAAc,EAAE,eAAe;QAC/B,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS;SAChB;KACF;CACF,CAAC","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 {\n OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\nimport {\n AnalyzeBatchInput as AnalyzeBatchInputMapper,\n MultiLanguageBatchInput as MultiLanguageBatchInputMapper,\n LanguageBatchInput as LanguageBatchInputMapper\n} from \"../models/mappers\";\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const body: OperationParameter = {\n parameterPath: [\"options\", \"body\"],\n mapper: AnalyzeBatchInputMapper\n};\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json, text/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const endpoint: OperationURLParameter = {\n parameterPath: \"endpoint\",\n mapper: {\n serializedName: \"Endpoint\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const apiVersion: OperationURLParameter = {\n parameterPath: \"apiVersion\",\n mapper: {\n defaultValue: \"v3.2-preview.
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../src/generated/models/parameters.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EACL,iBAAiB,IAAI,uBAAuB,EAC5C,uBAAuB,IAAI,6BAA6B,EACxD,kBAAkB,IAAI,wBAAwB,EAC/C,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,WAAW,GAAuB;IAC7C,aAAa,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC;IACzC,MAAM,EAAE;QACN,YAAY,EAAE,kBAAkB;QAChC,UAAU,EAAE,IAAI;QAChB,cAAc,EAAE,cAAc;QAC9B,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAuB;IACtC,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;IAClC,MAAM,EAAE,uBAAuB;CAChC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAuB;IACxC,aAAa,EAAE,QAAQ;IACvB,MAAM,EAAE;QACN,YAAY,EAAE,6BAA6B;QAC3C,UAAU,EAAE,IAAI;QAChB,cAAc,EAAE,QAAQ;QACxB,IAAI,EAAE;YACJ,I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J,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAA4B;IACpD,aAAa,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC;IAC3C,MAAM,EAAE;QACN,WAAW,EAAE;YACX,WAAW,EAAE,IAAI;SAClB;QACD,cAAc,EAAE,eAAe;QAC/B,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE;gBACP,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;KACF;IACD,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAuB;IACxC,aAAa,EAAE,OAAO;IACtB,MAAM,EAAE,wBAAwB;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAA4B;IACpD,aAAa,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC;IAC3C,MAAM,EAAE;QACN,cAAc,EAAE,eAAe;QAC/B,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS;SAChB;KACF;CACF,CAAC","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 {\n OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\nimport {\n AnalyzeBatchInput as AnalyzeBatchInputMapper,\n MultiLanguageBatchInput as MultiLanguageBatchInputMapper,\n LanguageBatchInput as LanguageBatchInputMapper\n} from \"../models/mappers\";\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const body: OperationParameter = {\n parameterPath: [\"options\", \"body\"],\n mapper: AnalyzeBatchInputMapper\n};\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json, text/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const endpoint: OperationURLParameter = {\n parameterPath: \"endpoint\",\n mapper: {\n serializedName: \"Endpoint\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const apiVersion: OperationURLParameter = {\n parameterPath: \"apiVersion\",\n mapper: {\n defaultValue: \"v3.2-preview.2\",\n isConstant: true,\n serializedName: \"ApiVersion\",\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const jobId: OperationURLParameter = {\n parameterPath: \"jobId\",\n mapper: {\n serializedName: \"jobId\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const includeStatistics: OperationQueryParameter = {\n parameterPath: [\"options\", \"includeStatistics\"],\n mapper: {\n serializedName: \"showStats\",\n type: {\n name: \"Boolean\"\n }\n }\n};\n\nexport const top: OperationQueryParameter = {\n parameterPath: [\"options\", \"top\"],\n mapper: {\n defaultValue: 20,\n constraints: {\n InclusiveMaximum: 50,\n InclusiveMinimum: 1\n },\n serializedName: \"$top\",\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const skip: OperationQueryParameter = {\n parameterPath: [\"options\", \"skip\"],\n mapper: {\n defaultValue: 0,\n constraints: {\n InclusiveMinimum: 0\n },\n serializedName: \"$skip\",\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const jobId1: OperationURLParameter = {\n parameterPath: \"jobId\",\n mapper: {\n serializedName: \"jobId\",\n required: true,\n type: {\n name: \"Uuid\"\n }\n }\n};\n\nexport const input: OperationParameter = {\n parameterPath: \"input\",\n mapper: MultiLanguageBatchInputMapper\n};\n\nexport const modelVersion: OperationQueryParameter = {\n parameterPath: [\"options\", \"modelVersion\"],\n mapper: {\n serializedName: \"model-version\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const stringIndexType: OperationQueryParameter = {\n parameterPath: [\"options\", \"stringIndexType\"],\n mapper: {\n serializedName: \"stringIndexType\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const loggingOptOut: OperationQueryParameter = {\n parameterPath: [\"options\", \"loggingOptOut\"],\n mapper: {\n serializedName: \"loggingOptOut\",\n type: {\n name: \"Boolean\"\n }\n }\n};\n\nexport const domain: OperationQueryParameter = {\n parameterPath: [\"options\", \"domain\"],\n mapper: {\n serializedName: \"domain\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const piiCategories: OperationQueryParameter = {\n parameterPath: [\"options\", \"piiCategories\"],\n mapper: {\n constraints: {\n UniqueItems: true\n },\n serializedName: \"piiCategories\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"CSV\"\n};\n\nexport const input1: OperationParameter = {\n parameterPath: \"input\",\n mapper: LanguageBatchInputMapper\n};\n\nexport const opinionMining: OperationQueryParameter = {\n parameterPath: [\"options\", \"opinionMining\"],\n mapper: {\n serializedName: \"opinionMining\",\n type: {\n name: \"Boolean\"\n }\n }\n};\n"]}
|
|
@@ -4,7 +4,7 @@ import { SpanStatusCode } from "@azure/core-tracing";
|
|
|
4
4
|
import { createSerializer } from "@azure/core-client";
|
|
5
5
|
import { makeHealthcareEntitiesErrorResult, makeHealthcareEntitiesResult } from "./analyzeHealthcareEntitiesResult";
|
|
6
6
|
import { createSpan } from "./tracing";
|
|
7
|
-
import { addStrEncodingParam, getRawResponse,
|
|
7
|
+
import { addStrEncodingParam, getRawResponse, compileError, sendGetRequest } from "./util";
|
|
8
8
|
import * as Mappers from "./generated/models/mappers";
|
|
9
9
|
import { accept, apiVersion, endpoint, includeStatistics, skip, top } from "./generated/models/parameters";
|
|
10
10
|
import { processAndCombineSuccessfulAndErroneousDocuments } from "./textAnalyticsResult";
|
|
@@ -52,7 +52,7 @@ export class HealthLro {
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
catch (e) {
|
|
55
|
-
const exception =
|
|
55
|
+
const exception = compileError(e);
|
|
56
56
|
span.setStatus({
|
|
57
57
|
code: SpanStatusCode.ERROR,
|
|
58
58
|
message: exception.message
|
|
@@ -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,0BAA0B,EAC1B,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;AACxD,MAAM,yBAAyB,GAAkB;IAC/C,IAAI,EAAE,+BAA+B;IACrC,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,kBAAkB;SACvC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE,IAAI,CAAC;IAC/C,aAAa,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;IACrC,gBAAgB,EAAE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0BAA0B;gBAC1B,WAAW,CAAC,CAAC,iCAAM,OAAO,KAAE,GAAG,EAAE,WAAW,IAAG,CAAC,CAAC,OAAO,EACxD,QAAQ,CACT,CAAC;gBACF,MAAM,YAAY,GAAG,QAAQ,CAAC,YAAmD,CAAC;gBAClF,IAAI,YAAY,CAAC,OAAO,EAAE;oBACxB,OAAO;wBACL,IAAI,EAAE,gDAAgD,CACpD,SAAS,EACT,YAAY,CAAC,OAAO,EACpB,4BAA4B,EAC5B,iCAAiC,CAClC;wBACD,YAAY,EAAE,YAAY,CAAC,QAAQ;qBACpC,CAAC;iBACH;qBAAM;oBACL,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;iBAC9E;YACH,CAAC;SACF,CAAC;QACF,MAAM,aAAa,GAAG,qBAAqB,CAGzC,WAAW,CAAC,CAAC;QACf,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE;YAClC,UAAU,EAAG,MAAc,CAAC,OAAO,CAAC,UAAU;YAC9C,YAAY,EAAG,MAAc,CAAC,OAAO,CAAC,YAAa;SACpD,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAsC,EACtC,YAAyB;IAEzB,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAW,CAAC;IAC1C,KAAK,CAAC,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 handleInvalidDocumentBatch,\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 = handleInvalidDocumentBatch(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,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;AACxD,MAAM,yBAAyB,GAAkB;IAC/C,IAAI,EAAE,+BAA+B;IACrC,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,kBAAkB;SACvC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE,IAAI,CAAC;IA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cAAc,CACnC,MAAM,EACN,yBAAyB,EACzB,cAAc;gBACd,qEAAqE;gBACrE,0BAA0B;gBAC1B,WAAW,CAAC,CAAC,iCAAM,OAAO,KAAE,GAAG,EAAE,WAAW,IAAG,CAAC,CAAC,OAAO,EACxD,QAAQ,CACT,CAAC;gBACF,MAAM,YAAY,GAAG,QAAQ,CAAC,YAAmD,CAAC;gBAClF,IAAI,YAAY,CAAC,OAAO,EAAE;oBACxB,OAAO;wBACL,IAAI,EAAE,gDAAgD,CACpD,SAAS,EACT,YAAY,CAAC,OAAO,EACpB,4BAA4B,EAC5B,iCAAiC,CAClC;wBACD,YAAY,EAAE,YAAY,CAAC,QAAQ;qBACpC,CAAC;iBACH;qBAAM;oBACL,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;iBAC9E;YACH,CAAC;SACF,CAAC;QACF,MAAM,aAAa,GAAG,qBAAqB,CAGzC,WAAW,CAAC,CAAC;QACf,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE;YAClC,UAAU,EAAG,MAAc,CAAC,OAAO,CAAC,UAAU;YAC9C,YAAY,EAAG,MAAc,CAAC,OAAO,CAAC,YAAa;SACpD,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAsC,EACtC,YAAyB;IAEzB,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAW,CAAC;IAC1C,KAAK,CAAC,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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,4CAA4C;AAE5C,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EACL,mBAAmB,EAQnB,eAAe,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,4CAA4C;AAE5C,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EACL,mBAAmB,EAQnB,eAAe,EAsBhB,MAAM,uBAAuB,CAAC;AA+H/B,SAAS;AACT,OAAO,EAYL,wBAAwB,EAExB,gBAAgB,EAchB,6BAA6B,EAG9B,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport \"@azure/core-asynciterator-polyfill\";\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"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
|
@@ -0,0 +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,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"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
import { makeTextAnalyticsSuccessResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export function makeSingleCategoryClassifyResult(result) {
|
|
8
|
+
const { id, warnings, statistics, classification } = result;
|
|
9
|
+
return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { classification });
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export function makeSingleCategoryClassifyErrorResult(id, error) {
|
|
15
|
+
return makeTextAnalyticsErrorResult(id, error);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=singleCategoryClassifyResult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singleCategoryClassifyResult.js","sourceRoot":"","sources":["../../src/singleCategoryClassifyResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,8BAA8B,EAG9B,4BAA4B,EAC7B,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"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
import { makeSingleCategoryClassifyResult, makeSingleCategoryClassifyErrorResult } from "./singleCategoryClassifyResult";
|
|
4
|
+
import { combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo } from "./textAnalyticsResult";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export function makeSingleCategoryClassifyResultArray(input, response) {
|
|
9
|
+
return combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInfo(input, response, makeSingleCategoryClassifyResult, makeSingleCategoryClassifyErrorResult);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=singleCategoryClassifyResultArray.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singleCategoryClassifyResultArray.js","sourceRoot":"","sources":["../../src/singleCategoryClassifyResultArray.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAEL,gCAAgC,EAChC,qCAAqC,EACtC,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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textAnalyticsAction.js","sourceRoot":"","sources":["../../src/textAnalyticsAction.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * The type of a text analytics action.\n */\nexport interface TextAnalyticsAction {\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 * The preferred name for this action.\n */\n actionName?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"textAnalyticsAction.js","sourceRoot":"","sources":["../../src/textAnalyticsAction.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * The type of a standard text analytics action.\n */\nexport interface TextAnalyticsAction {\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 * The preferred name for this action.\n */\n actionName?: string;\n}\n\n/**\n * The type of a custom text analytics action.\n */\nexport interface CustomTextAnalyticsAction {\n /**\n * The project name for the text analytics model used by this operation on this\n * batch of input documents.\n */\n projectName: string;\n /**\n * The deployment name for the text analytics model used by this operation on this\n * batch of input documents.\n */\n deploymentName: string;\n /**\n * The preferred name for this action.\n */\n actionName?: string;\n}\n"]}
|
|
@@ -14,7 +14,7 @@ import { makeRecognizeLinkedEntitiesResultArray } from "./recognizeLinkedEntitie
|
|
|
14
14
|
import { createSpan } from "./tracing";
|
|
15
15
|
import { SpanStatusCode } from "@azure/core-tracing";
|
|
16
16
|
import { textAnalyticsAzureKeyCredentialPolicy } from "./azureKeyCredentialPolicy";
|
|
17
|
-
import { addParamsToTask, compose,
|
|
17
|
+
import { addParamsToTask, compose, compileError, setCategoriesFilter, setOpinionMining, setOrderBy, setSentenceCount, setStrEncodingParam, setStrEncodingParamValue } from "./util";
|
|
18
18
|
import { HealthLro, isHealthDone, processHealthResult, updateHealthState } from "./healthLro";
|
|
19
19
|
import { LroEngine } from "@azure/core-lro";
|
|
20
20
|
import { AnalyzeLro, isAnalyzeDone, processAnalyzeResult, updateAnalyzeState } from "./analyzeLro";
|
|
@@ -133,7 +133,7 @@ export class TextAnalyticsClient {
|
|
|
133
133
|
* earlier versions were throwing an exception that included the inner
|
|
134
134
|
* code only.
|
|
135
135
|
*/
|
|
136
|
-
const backwardCompatibleException =
|
|
136
|
+
const backwardCompatibleException = compileError(e);
|
|
137
137
|
span.setStatus({
|
|
138
138
|
code: SpanStatusCode.ERROR,
|
|
139
139
|
message: backwardCompatibleException.message
|
|
@@ -325,7 +325,6 @@ export class TextAnalyticsClient {
|
|
|
325
325
|
realInputs = documents;
|
|
326
326
|
realOptions = languageOrOptions || {};
|
|
327
327
|
}
|
|
328
|
-
validateActions(actions);
|
|
329
328
|
const compiledActions = compileAnalyzeInput(actions);
|
|
330
329
|
const { updateIntervalInMs, resumeFrom, displayName, includeStatistics, onResponse, requestOptions, serializerOptions, abortSignal, tracingOptions } = realOptions;
|
|
331
330
|
const lro = new AnalyzeLro(this.client, {
|
|
@@ -353,32 +352,21 @@ export class TextAnalyticsClient {
|
|
|
353
352
|
return poller;
|
|
354
353
|
}
|
|
355
354
|
}
|
|
356
|
-
function validateActions(actions) {
|
|
357
|
-
function validateActionType(actionList, actionType) {
|
|
358
|
-
var _a;
|
|
359
|
-
if (((_a = actionList === null || actionList === void 0 ? void 0 : actionList.length) !== null && _a !== void 0 ? _a : 0) > 1) {
|
|
360
|
-
throw new Error(`beginAnalyzeActions: Currently, the service can accept up to one action only for ${actionType} actions.`);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
validateActionType(actions.analyzeSentimentActions, `analyzeSentiment`);
|
|
364
|
-
validateActionType(actions.extractKeyPhrasesActions, `extractKeyPhrases`);
|
|
365
|
-
validateActionType(actions.recognizeEntitiesActions, `recognizeEntities`);
|
|
366
|
-
validateActionType(actions.recognizeLinkedEntitiesActions, `recognizeLinkedEntities`);
|
|
367
|
-
validateActionType(actions.recognizePiiEntitiesActions, `recognizePiiEntities`);
|
|
368
|
-
validateActionType(actions.extractSummaryActions, `extractSummary`);
|
|
369
|
-
}
|
|
370
355
|
/**
|
|
371
356
|
* @internal
|
|
372
357
|
*/
|
|
373
358
|
function compileAnalyzeInput(actions) {
|
|
374
|
-
var _a, _b, _c, _d, _e, _f;
|
|
359
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
375
360
|
return {
|
|
376
361
|
entityRecognitionPiiTasks: (_a = actions.recognizePiiEntitiesActions) === null || _a === void 0 ? void 0 : _a.map(compose(setStrEncodingParam, compose(setCategoriesFilter, addParamsToTask))),
|
|
377
362
|
entityRecognitionTasks: (_b = actions.recognizeEntitiesActions) === null || _b === void 0 ? void 0 : _b.map(compose(setStrEncodingParam, addParamsToTask)),
|
|
378
363
|
keyPhraseExtractionTasks: (_c = actions.extractKeyPhrasesActions) === null || _c === void 0 ? void 0 : _c.map(addParamsToTask),
|
|
379
364
|
entityLinkingTasks: (_d = actions.recognizeLinkedEntitiesActions) === null || _d === void 0 ? void 0 : _d.map(compose(setStrEncodingParam, addParamsToTask)),
|
|
380
365
|
sentimentAnalysisTasks: (_e = actions.analyzeSentimentActions) === null || _e === void 0 ? void 0 : _e.map(compose(setStrEncodingParam, compose(setOpinionMining, addParamsToTask))),
|
|
381
|
-
extractiveSummarizationTasks: (_f = actions.extractSummaryActions) === null || _f === void 0 ? void 0 : _f.map(compose(setStrEncodingParam, compose(setSentenceCount, compose(setOrderBy, addParamsToTask))))
|
|
366
|
+
extractiveSummarizationTasks: (_f = actions.extractSummaryActions) === null || _f === void 0 ? void 0 : _f.map(compose(setStrEncodingParam, compose(setSentenceCount, compose(setOrderBy, addParamsToTask)))),
|
|
367
|
+
customEntityRecognitionTasks: (_g = actions.recognizeCustomEntitiesActions) === null || _g === void 0 ? void 0 : _g.map(compose(setStrEncodingParam, addParamsToTask)),
|
|
368
|
+
customSingleClassificationTasks: (_h = actions.singleCategoryClassifyActions) === null || _h === void 0 ? void 0 : _h.map(addParamsToTask),
|
|
369
|
+
customMultiClassificationTasks: (_j = actions.multiCategoryClassifyActions) === null || _j === void 0 ? void 0 : _j.map(addParamsToTask)
|
|
382
370
|
};
|
|
383
371
|
}
|
|
384
372
|
function isStringArray(documents) {
|