@azure/ai-text-analytics 5.2.0-alpha.20220407.1 → 5.2.0-alpha.20220421.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.
@@ -1 +1 @@
1
- {"version":3,"file":"analyzeLro.js","sourceRoot":"","sources":["../../src/analyzeLro.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAmC,MAAM,oBAAoB,CAAC;AAQvF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACtE,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,qBAAqB,EAAe,MAAM,oBAAoB,CAAC;AAExE,OAAO,EAEL,0BAA0B,GAE3B,MAAM,wBAAwB,CAAC;AA6DhC,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAEhE,wDAAwD;AACxD,MAAM,0BAA0B,GAAkB;IAChD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,eAAe;SACpC;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,CAAC,MAAM,CAAC;IAC1B,UAAU;CACX,CAAC;AAEF;;GAEG;AACH,MAAM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3E,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;IAC/B,KAAK,CAAC,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC;IACvD,KAAK,CAAC,kBAAkB,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;IACjD,KAAK,CAAC,sBAAsB,GAAG,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC;IACzD,KAAK,CAAC,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;AAC3C,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 GeneratedClient,\n GeneratedClientAnalyzeStatusOptionalParams,\n GeneratedClientAnalyzeStatusResponse,\n JobManifestTasks,\n TextDocumentInput,\n} from \"./generated\";\nimport { createSpan } from \"./tracing\";\nimport { compileError, getRawResponse, sendGetRequest } 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 { getPagedAsyncIterator, PagedResult } from \"@azure/core-paging\";\nimport { AnalysisPollOperationState, OperationMetadata } from \"./pollerModels\";\nimport {\n AnalyzeActionsResult,\n createAnalyzeActionsResult,\n PagedAnalyzeActionsResult,\n} from \"./analyzeActionsResult\";\n\n/**\n * Options for the begin analyze actions operation.\n */\nexport interface BeginAnalyzeActionsOptions extends OperationOptions {\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 * If set to true, response will contain input and document level statistics.\n */\n includeStatistics?: boolean;\n /**\n * The operation's display name.\n */\n displayName?: string;\n}\n\n/**\n * Result type of the Begin Analyze Actions Long-Running-Operation (LRO).\n */\nexport type AnalyzeActionsPollerLike = PollerLike<\n AnalyzeActionsOperationState,\n PagedAnalyzeActionsResult\n>;\n\n/**\n * The metadata for beginAnalyzeActions operations.\n */\nexport interface AnalyzeActionsOperationMetadata extends OperationMetadata {\n /**\n * Number of successfully completed actions.\n */\n actionsSucceededCount: number;\n /**\n * Number of failed actions.\n */\n actionsFailedCount: number;\n /**\n * Number of actions still in progress.\n */\n actionsInProgressCount: number;\n /**\n * The operation's display name.\n */\n displayName?: string;\n}\n\n/**\n * The state of the begin analyze polling operation.\n */\nexport interface AnalyzeActionsOperationState\n extends AnalysisPollOperationState<PagedAnalyzeActionsResult>,\n AnalyzeActionsOperationMetadata {}\n\nconst serializer = createSerializer(Mappers, /* isXml */ false);\n\n// Consider whether the spec can be exported by code gen\nconst analyzeStatusOperationSpec: OperationSpec = {\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeJobState,\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 AnalyzeLro implements LongRunningOperation<PagedAnalyzeActionsResult> {\n public requestMethod = \"POST\";\n public requestPath = \"/analyze\";\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 displayName?: string;\n },\n private pollOptions: {\n includeStatistics?: boolean;\n },\n private documents: TextDocumentInput[],\n private tasks: JobManifestTasks\n ) {}\n async sendInitialRequest(): Promise<LroResponse<PagedAnalyzeActionsResult>> {\n const { span, updatedOptions: finalOptions } = createSpan(\"TextAnalyticsClient-beginAnalyze\", {\n ...this.baseOptions,\n ...this.initOptions,\n });\n try {\n const { flatResponse, rawResponse } = await getRawResponse(\n (paramOptions) =>\n this.client.analyze({\n body: {\n analysisInput: { documents: this.documents },\n tasks: this.tasks,\n displayName: this.initOptions.displayName,\n },\n ...paramOptions,\n }),\n finalOptions\n );\n return {\n flatResponse: flatResponse as PagedAnalyzeActionsResult,\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<PagedAnalyzeActionsResult>> {\n return sendGetRequest(\n this.client,\n analyzeStatusOperationSpec,\n \"AnalyzeStatus\",\n { ...this.baseOptions, ...this.pollOptions },\n path\n ) as Promise<LroResponse<PagedAnalyzeActionsResult>>;\n }\n}\n\n/**\n * @internal\n */\nexport function processAnalyzeResult(\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n client: GeneratedClient,\n documents: TextDocumentInput[],\n options: GeneratedClientAnalyzeStatusOptionalParams\n): (result: unknown, state: AnalyzeActionsOperationState) => PagedAnalyzeActionsResult {\n return (_result: unknown, state: AnalyzeActionsOperationState): PagedAnalyzeActionsResult => {\n const pollingURL = (state as any).pollingURL;\n const pagedResult: PagedResult<AnalyzeActionsResult> = {\n firstPageLink: pollingURL,\n getPage: async (pageLink: string, maxPageSize?: number) => {\n const response = await sendGetRequest(\n client,\n analyzeStatusOperationSpec,\n \"AnalyzeStatus\",\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 GeneratedClientAnalyzeStatusResponse;\n return {\n page: createAnalyzeActionsResult(flatResponse, documents),\n nextPageLink: flatResponse.nextLink,\n };\n },\n };\n const pagedIterator = getPagedAsyncIterator<AnalyzeActionsResult, AnalyzeActionsResult>(\n pagedResult\n );\n // Attach stats if the service starts to return them\n // https://github.com/Azure/azure-sdk-for-js/issues/14139\n // state.result = Object.assign(pagedIterator, {\n // statistics: operationStatus.statistics\n // });\n return pagedIterator;\n };\n}\n\n/**\n * @internal\n */\nexport function updateAnalyzeState(\n state: AnalyzeActionsOperationState,\n lastResponse: RawResponse\n): void {\n const response = lastResponse.body as GeneratedClientAnalyzeStatusResponse;\n state.createdOn = response.createdDateTime;\n state.lastModifiedOn = response.lastUpdateDateTime;\n state.expiresOn = response.expirationDateTime;\n state.status = response.status;\n state.actionsSucceededCount = response.tasks.completed;\n state.actionsFailedCount = response.tasks.failed;\n state.actionsInProgressCount = response.tasks.inProgress;\n state.displayName = response.displayName;\n}\n"]}
1
+ {"version":3,"file":"analyzeLro.js","sourceRoot":"","sources":["../../src/analyzeLro.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAmC,MAAM,oBAAoB,CAAC;AAQvF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACtE,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,qBAAqB,EAAe,MAAM,oBAAoB,CAAC;AAExE,OAAO,EAEL,0BAA0B,GAE3B,MAAM,wBAAwB,CAAC;AA6DhC,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAEhE,wDAAwD;AACxD,MAAM,0BAA0B,GAAkB;IAChD,UAAU,EAAE,KAAK;IAC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iBACpC,CAAC;YACJ,CAAC;SACF,CAAC;QACF,MAAM,aAAa,GAAG,qBAAqB,CACzC,WAAW,CACZ,CAAC;QACF,oDAAoD;QACpD,yDAAyD;QACzD,gDAAgD;QAChD,2CAA2C;QAC3C,MAAM;QACN,OAAO,aAAa,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAmC,EACnC,YAAyB;IAEzB,MAAM,QAAQ,GAAG,YAAY,CAAC,IAA4C,CAAC;IAC3E,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;IAC/B,KAAK,CAAC,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC;IACvD,KAAK,CAAC,kBAAkB,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;IACjD,KAAK,CAAC,sBAAsB,GAAG,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC;IACzD,KAAK,CAAC,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;AAC3C,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 GeneratedClient,\n GeneratedClientAnalyzeStatusOptionalParams,\n GeneratedClientAnalyzeStatusResponse,\n JobManifestTasks,\n TextDocumentInput,\n} from \"./generated\";\nimport { createSpan } from \"./tracing\";\nimport { compileError, getRawResponse, sendGetRequest } 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 { getPagedAsyncIterator, PagedResult } from \"@azure/core-paging\";\nimport { AnalysisPollOperationState, OperationMetadata } from \"./pollerModels\";\nimport {\n AnalyzeActionsResult,\n createAnalyzeActionsResult,\n PagedAnalyzeActionsResult,\n} from \"./analyzeActionsResult\";\n\n/**\n * Options for the begin analyze actions operation.\n */\nexport interface BeginAnalyzeActionsOptions extends OperationOptions {\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 * If set to true, response will contain input and document level statistics.\n */\n includeStatistics?: boolean;\n /**\n * The operation's display name.\n */\n displayName?: string;\n}\n\n/**\n * Result type of the Begin Analyze Actions Long-Running-Operation (LRO).\n */\nexport type AnalyzeActionsPollerLike = PollerLike<\n AnalyzeActionsOperationState,\n PagedAnalyzeActionsResult\n>;\n\n/**\n * The metadata for beginAnalyzeActions operations.\n */\nexport interface AnalyzeActionsOperationMetadata extends OperationMetadata {\n /**\n * Number of successfully completed actions.\n */\n actionsSucceededCount: number;\n /**\n * Number of failed actions.\n */\n actionsFailedCount: number;\n /**\n * Number of actions still in progress.\n */\n actionsInProgressCount: number;\n /**\n * The operation's display name.\n */\n displayName?: string;\n}\n\n/**\n * The state of the begin analyze polling operation.\n */\nexport interface AnalyzeActionsOperationState\n extends AnalysisPollOperationState<PagedAnalyzeActionsResult>,\n AnalyzeActionsOperationMetadata {}\n\nconst serializer = createSerializer(Mappers, /* isXml */ false);\n\n// Consider whether the spec can be exported by code gen\nconst analyzeStatusOperationSpec: OperationSpec = {\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeJobState,\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 AnalyzeLro implements LongRunningOperation<PagedAnalyzeActionsResult> {\n public requestMethod = \"POST\";\n public requestPath = \"/analyze\";\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 displayName?: string;\n },\n private pollOptions: {\n includeStatistics?: boolean;\n },\n private documents: TextDocumentInput[],\n private tasks: JobManifestTasks\n ) {}\n async sendInitialRequest(): Promise<LroResponse<PagedAnalyzeActionsResult>> {\n const { span, updatedOptions: finalOptions } = createSpan(\"TextAnalyticsClient-beginAnalyze\", {\n ...this.baseOptions,\n ...this.initOptions,\n });\n try {\n const { flatResponse, rawResponse } = await getRawResponse(\n (paramOptions) =>\n this.client.analyze({\n body: {\n analysisInput: { documents: this.documents },\n tasks: this.tasks,\n displayName: this.initOptions.displayName,\n },\n ...paramOptions,\n }),\n finalOptions\n );\n return {\n flatResponse: flatResponse as PagedAnalyzeActionsResult,\n rawResponse,\n };\n } catch (e: any) {\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<PagedAnalyzeActionsResult>> {\n return sendGetRequest(\n this.client,\n analyzeStatusOperationSpec,\n \"AnalyzeStatus\",\n { ...this.baseOptions, ...this.pollOptions },\n path\n ) as Promise<LroResponse<PagedAnalyzeActionsResult>>;\n }\n}\n\n/**\n * @internal\n */\nexport function processAnalyzeResult(\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n client: GeneratedClient,\n documents: TextDocumentInput[],\n options: GeneratedClientAnalyzeStatusOptionalParams\n): (result: unknown, state: AnalyzeActionsOperationState) => PagedAnalyzeActionsResult {\n return (_result: unknown, state: AnalyzeActionsOperationState): PagedAnalyzeActionsResult => {\n const pollingURL = (state as any).pollingURL;\n const pagedResult: PagedResult<AnalyzeActionsResult> = {\n firstPageLink: pollingURL,\n getPage: async (pageLink: string, maxPageSize?: number) => {\n const response = await sendGetRequest(\n client,\n analyzeStatusOperationSpec,\n \"AnalyzeStatus\",\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 GeneratedClientAnalyzeStatusResponse;\n return {\n page: createAnalyzeActionsResult(flatResponse, documents),\n nextPageLink: flatResponse.nextLink,\n };\n },\n };\n const pagedIterator = getPagedAsyncIterator<AnalyzeActionsResult, AnalyzeActionsResult>(\n pagedResult\n );\n // Attach stats if the service starts to return them\n // https://github.com/Azure/azure-sdk-for-js/issues/14139\n // state.result = Object.assign(pagedIterator, {\n // statistics: operationStatus.statistics\n // });\n return pagedIterator;\n };\n}\n\n/**\n * @internal\n */\nexport function updateAnalyzeState(\n state: AnalyzeActionsOperationState,\n lastResponse: RawResponse\n): void {\n const response = lastResponse.body as GeneratedClientAnalyzeStatusResponse;\n state.createdOn = response.createdDateTime;\n state.lastModifiedOn = response.lastUpdateDateTime;\n state.expiresOn = response.expirationDateTime;\n state.status = response.status;\n state.actionsSucceededCount = response.tasks.completed;\n state.actionsFailedCount = response.tasks.failed;\n state.actionsInProgressCount = response.tasks.inProgress;\n state.displayName = response.displayName;\n}\n"]}
@@ -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,GAE7B,MAAM,mCAAmC,CAAC;AAO3C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,cAAc,GAEf,MAAM,QA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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
+ {"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,EAC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,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: any) {\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":"textAnalyticsClient.js","sourceRoot":"","sources":["../../src/textAnalyticsClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EAEL,+BAA+B,GAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAkC,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAA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,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommonClientOptions } from \"@azure/core-client\";\nimport {\n InternalPipelineOptions,\n bearerTokenAuthenticationPolicy,\n} from \"@azure/core-rest-pipeline\";\nimport { TokenCredential, KeyCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { GeneratedClient } from \"./generated/generatedClient\";\nimport { logger } from \"./logger\";\nimport {\n JobManifestTasks as GeneratedActions,\n DetectLanguageInput,\n GeneratedClientEntitiesRecognitionPiiOptionalParams as GeneratedRecognizePiiEntitiesOptions,\n GeneratedClientSentimentOptionalParams as GeneratedAnalyzeSentimentOptions,\n GeneratedClientEntitiesRecognitionGeneralOptionalParams as GeneratedRecognizeCategorizedEntitiesOptions,\n GeneratedClientEntitiesLinkingOptionalParams as GeneratedRecognizeLinkedEntitiesOptions,\n GeneratedClientKeyPhrasesOptionalParams as GeneratedExtractKeyPhrasesOptions,\n GeneratedClientLanguagesOptionalParams as GeneratedDetectLanguageOptions,\n TextDocumentInput,\n PiiCategory,\n} from \"./generated/models\";\nimport {\n DetectLanguageResultArray,\n makeDetectLanguageResultArray,\n} from \"./detectLanguageResultArray\";\nimport {\n RecognizeCategorizedEntitiesResultArray,\n makeRecognizeCategorizedEntitiesResultArray,\n} from \"./recognizeCategorizedEntitiesResultArray\";\nimport {\n AnalyzeSentimentResultArray,\n makeAnalyzeSentimentResultArray,\n} from \"./analyzeSentimentResultArray\";\nimport {\n makeExtractKeyPhrasesResultArray,\n ExtractKeyPhrasesResultArray,\n} from \"./extractKeyPhrasesResultArray\";\nimport {\n RecognizePiiEntitiesResultArray,\n makeRecognizePiiEntitiesResultArray,\n} from \"./recognizePiiEntitiesResultArray\";\nimport {\n RecognizeLinkedEntitiesResultArray,\n makeRecognizeLinkedEntitiesResultArray,\n} from \"./recognizeLinkedEntitiesResultArray\";\nimport { createSpan } from \"./tracing\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport { textAnalyticsAzureKeyCredentialPolicy } from \"./azureKeyCredentialPolicy\";\nimport {\n addParamsToTask,\n compose,\n compileError,\n setCategoriesFilter,\n setOpinionMining,\n setOrderBy,\n setSentenceCount,\n setStrEncodingParam,\n setStrEncodingParamValue,\n StringIndexType,\n} from \"./util\";\nimport { TextAnalyticsOperationOptions } from \"./textAnalyticsOperationOptions\";\nimport { AnalysisPollOperationState, OperationMetadata } from \"./pollerModels\";\nimport { CustomTextAnalyticsAction, TextAnalyticsAction } from \"./textAnalyticsAction\";\nimport {\n AnalyzeHealthcareEntitiesPollerLike,\n AnalyzeHealthcareOperationState,\n BeginAnalyzeHealthcareEntitiesOptions,\n HealthLro,\n isHealthDone,\n processHealthResult,\n updateHealthState,\n} from \"./healthLro\";\nimport { LroEngine } from \"@azure/core-lro\";\nimport { PagedAnalyzeHealthcareEntitiesResult } from \"./analyzeHealthcareEntitiesResult\";\nimport {\n AnalyzeActionsOperationMetadata,\n AnalyzeActionsOperationState,\n AnalyzeActionsPollerLike,\n AnalyzeLro,\n BeginAnalyzeActionsOptions,\n processAnalyzeResult,\n updateAnalyzeState,\n} from \"./analyzeLro\";\nimport { PagedAnalyzeActionsResult } from \"./analyzeActionsResult\";\n\nexport {\n BeginAnalyzeActionsOptions,\n AnalyzeActionsPollerLike,\n AnalyzeActionsOperationState,\n BeginAnalyzeHealthcareEntitiesOptions,\n AnalyzeHealthcareEntitiesPollerLike,\n AnalyzeHealthcareOperationState,\n AnalysisPollOperationState,\n OperationMetadata,\n AnalyzeActionsOperationMetadata,\n StringIndexType,\n};\n\nconst DEFAULT_COGNITIVE_SCOPE = \"https://cognitiveservices.azure.com/.default\";\n\n/**\n * Client options used to configure TextAnalytics API requests.\n */\nexport interface TextAnalyticsClientOptions extends CommonClientOptions {\n /**\n * The default country hint to use. Defaults to \"us\".\n */\n defaultCountryHint?: string;\n\n /**\n * The default language to use. Defaults to \"en\".\n */\n defaultLanguage?: string;\n}\n\n/**\n * Options for the detect languages operation.\n */\nexport interface DetectLanguageOptions extends TextAnalyticsOperationOptions {}\n\n/**\n * Options for the recognize entities operation.\n */\nexport interface RecognizeCategorizedEntitiesOptions extends TextAnalyticsOperationOptions {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n}\n\n/**\n * Options for the analyze sentiment operation.\n */\nexport interface AnalyzeSentimentOptions extends TextAnalyticsOperationOptions {\n /**\n * Whether to mine the opinions of a sentence and conduct more granular\n * analysis around the aspects of a product or service (also known as\n * aspect-based sentiment analysis). If set to true, the returned\n * `SentenceSentiment` objects will have property `opinions` containing\n * the result of this analysis.\n * More information about the feature can be found here: {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis?tabs=version-3-1#opinion-mining}\n */\n includeOpinionMining?: boolean;\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n}\n\n/**\n * The types of PII domains the user can choose from.\n */\nexport enum PiiEntityDomain {\n /**\n * @see {@link https://aka.ms/tanerpii} for more information.\n */\n PROTECTED_HEALTH_INFORMATION = \"PHI\",\n}\n\n/**\n * Options for the recognize PII entities operation.\n */\nexport interface RecognizePiiEntitiesOptions extends TextAnalyticsOperationOptions {\n /**\n * Filters entities to ones only included in the specified domain (e.g., if\n * set to 'PHI', entities in the Protected Healthcare Information domain will\n * only be returned). @see {@link https://aka.ms/tanerpii} for more information.\n */\n domainFilter?: PiiEntityDomain;\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * Filters entities to ones only included in the specified array of categories\n */\n categoriesFilter?: PiiCategory[];\n}\n\n/**\n * Options for the extract key phrases operation.\n */\nexport interface ExtractKeyPhrasesOptions extends TextAnalyticsOperationOptions {}\n\n/**\n * Options for the recognize linked entities operation.\n */\nexport interface RecognizeLinkedEntitiesOptions extends TextAnalyticsOperationOptions {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n}\n\n/**\n * Options for an entities recognition action.\n */\nexport interface RecognizeCategorizedEntitiesAction extends TextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for a Pii entities recognition action.\n */\nexport interface RecognizePiiEntitiesAction extends TextAnalyticsAction {\n /**\n * Filters entities to ones only included in the specified domain (e.g., if\n * set to 'PHI', entities in the Protected Healthcare Information domain will\n * only be returned). @see {@link https://aka.ms/tanerpii} for more information.\n */\n domainFilter?: PiiEntityDomain;\n /**\n * Filters entities to ones only included in the specified array of categories\n */\n categoriesFilter?: PiiCategory[];\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to false, you opt-in to have your text input logged for troubleshooting. By default, Text Analytics\n * will not log your input text for pii entities recognition. Setting this parameter to false,\n * enables input logging.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for a key phrases recognition action.\n */\nexport interface ExtractKeyPhrasesAction extends TextAnalyticsAction {\n /**\n * If set to false, you opt-in to have your text input logged for troubleshooting. By default, Text Analytics\n * will not log your input text for pii entities recognition. Setting this parameter to false,\n * enables input logging.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for an entities linking action.\n */\nexport interface RecognizeLinkedEntitiesAction extends TextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for an analyze sentiment action.\n */\nexport interface AnalyzeSentimentAction extends TextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n /**\n * Whether to mine the opinions of a sentence and conduct more granular\n * analysis around the aspects of a product or service (also known as\n * aspect-based sentiment analysis). If set to true, the returned\n * `SentenceSentiment` objects will have property `opinions` containing\n * the result of this analysis.\n * More information about the feature can be found here: {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis?tabs=version-3-1#opinion-mining}\n */\n includeOpinionMining?: boolean;\n}\n\n/**\n * A type representing how to sort sentences for the summarization extraction action.\n */\nexport type KnownSummarySentencesSortBy = \"Offset\" | \"Rank\";\n\n/**\n * Options for an extract summary action.\n */\nexport interface ExtractSummaryAction extends TextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n /**\n * Specifies the number of summary sentences to return. The default number of sentences is 3.\n */\n maxSentenceCount?: number;\n /**\n * Specifies how to sort the returned sentences. Please refer to {@link KnownSummarySentencesOrderBy} for possible values.\n */\n orderBy?: string;\n}\n\n/**\n * Options for a custom recognize entities action. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customentityrecognition}\n */\nexport interface RecognizeCustomEntitiesAction extends CustomTextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for an custom classify document single category action. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}\n */\nexport interface SingleCategoryClassifyAction extends CustomTextAnalyticsAction {\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for a custom classify document multi categories action. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}\n */\nexport interface MultiCategoryClassifyAction extends CustomTextAnalyticsAction {\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Description of collection of actions for the analyze API to perform on input documents.\n */\nexport interface TextAnalyticsActions {\n /**\n * A collection of descriptions of entities recognition actions.\n */\n recognizeEntitiesActions?: RecognizeCategorizedEntitiesAction[];\n /**\n * A collection of descriptions of Pii entities recognition actions.\n */\n recognizePiiEntitiesActions?: RecognizePiiEntitiesAction[];\n /**\n * A collection of descriptions of key phrases recognition actions.\n */\n extractKeyPhrasesActions?: ExtractKeyPhrasesAction[];\n /**\n * A collection of descriptions of entities linking actions.\n */\n recognizeLinkedEntitiesActions?: RecognizeLinkedEntitiesAction[];\n /**\n * A collection of descriptions of sentiment analysis actions.\n */\n analyzeSentimentActions?: AnalyzeSentimentAction[];\n /**\n * A collection of descriptions of summarization extraction actions.\n */\n extractSummaryActions?: ExtractSummaryAction[];\n /**\n * A collection of descriptions of custom entity recognition actions. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customentityrecognition}\n */\n recognizeCustomEntitiesActions?: RecognizeCustomEntitiesAction[];\n /**\n * A collection of descriptions of custom single classification actions. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}\n */\n singleCategoryClassifyActions?: SingleCategoryClassifyAction[];\n /**\n * A collection of descriptions of custom multi classification actions. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}\n */\n multiCategoryClassifyActions?: MultiCategoryClassifyAction[];\n}\n/**\n * Client class for interacting with Azure Text Analytics.\n */\nexport class TextAnalyticsClient {\n /**\n * The URL to the TextAnalytics endpoint\n */\n public readonly endpointUrl: string;\n\n /**\n * The default country hint to use. Defaults to \"us\".\n */\n public defaultCountryHint: string;\n\n /**\n * The default language to use. Defaults to \"en\".\n */\n public defaultLanguage: string;\n\n /**\n * @internal\n * A reference to the auto-generated TextAnalytics HTTP client.\n */\n private readonly client: GeneratedClient;\n\n /**\n * Creates an instance of TextAnalyticsClient.\n *\n * Example usage:\n * ```ts\n * import { TextAnalyticsClient, AzureKeyCredential } from \"@azure/ai-text-analytics\";\n *\n * const client = new TextAnalyticsClient(\n * \"<service endpoint>\",\n * new AzureKeyCredential(\"<api key>\")\n * );\n * ```\n * @param endpointUrl - The URL to the TextAnalytics endpoint\n * @param credential - Used to authenticate requests to the service.\n * @param options - Used to configure the TextAnalytics client.\n */\n constructor(\n endpointUrl: string,\n credential: TokenCredential | KeyCredential,\n options: TextAnalyticsClientOptions = {}\n ) {\n this.endpointUrl = endpointUrl;\n const { defaultCountryHint = \"us\", defaultLanguage = \"en\", ...pipelineOptions } = options;\n this.defaultCountryHint = defaultCountryHint;\n this.defaultLanguage = defaultLanguage;\n\n const internalPipelineOptions: InternalPipelineOptions = {\n ...pipelineOptions,\n ...{\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\"x-ms-correlation-request-id\", \"x-ms-request-id\"],\n },\n },\n };\n\n this.client = new GeneratedClient(this.endpointUrl, internalPipelineOptions);\n\n const authPolicy = isTokenCredential(credential)\n ? bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_COGNITIVE_SCOPE })\n : textAnalyticsAzureKeyCredentialPolicy(credential);\n\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Runs a predictive model to determine the language that the passed-in\n * input strings are written in, and returns, for each one, the detected\n * language as well as a score indicating the model's confidence that the\n * inferred language is correct. Scores close to 1 indicate high certainty in\n * the result. 120 languages are supported.\n * @param documents - A collection of input strings to analyze.\n * @param countryHint - Indicates the country of origin for all of\n * the input strings to assist the text analytics model in predicting\n * the language they are written in. If unspecified, this value will be\n * set to the default country hint in `TextAnalyticsClientOptions`.\n * If set to an empty string, or the string \"none\", the service will apply a\n * model where the country is explicitly unset.\n * The same country hint is applied to all strings in the input collection.\n * @param options - Optional parameters for the operation.\n */\n public async detectLanguage(\n documents: string[],\n countryHint?: string,\n options?: DetectLanguageOptions\n ): Promise<DetectLanguageResultArray>;\n /**\n * Runs a predictive model to determine the language that the passed-in\n * input document are written in, and returns, for each one, the detected\n * language as well as a score indicating the model's confidence that the\n * inferred language is correct. Scores close to 1 indicate high certainty in\n * the result. 120 languages are supported.\n * @param documents - A collection of input documents to analyze.\n * @param options - Optional parameters for the operation.\n */\n public async detectLanguage(\n documents: DetectLanguageInput[],\n options?: DetectLanguageOptions\n ): Promise<DetectLanguageResultArray>;\n public async detectLanguage(\n documents: string[] | DetectLanguageInput[],\n countryHintOrOptions?: string | DetectLanguageOptions,\n options?: DetectLanguageOptions\n ): Promise<DetectLanguageResultArray> {\n let realOptions: DetectLanguageOptions;\n let realInputs: DetectLanguageInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const countryHint = (countryHintOrOptions as string) || this.defaultCountryHint;\n realInputs = convertToDetectLanguageInput(documents, countryHint);\n realOptions = options || {};\n } else {\n // Replace \"none\" hints with \"\"\n realInputs = documents.map((input) => ({\n ...input,\n countryHint: input.countryHint === \"none\" ? \"\" : input.countryHint,\n }));\n realOptions = (countryHintOrOptions as DetectLanguageOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-detectLanguages\",\n makeGeneratedDetectLanguageOptions(realOptions)\n );\n\n try {\n const result = await this.client.languages(\n {\n documents: realInputs,\n },\n finalOptions\n );\n\n return makeDetectLanguageResultArray(realInputs, result);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a predictive model to identify a collection of named entities\n * in the passed-in input strings, and categorize those entities into types\n * such as person, location, or organization. For more information on \n * available categories, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types}.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Optional parameters for the operation.\n */\n public async recognizeEntities(\n documents: string[],\n language?: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: RecognizeCategorizedEntitiesOptions\n ): Promise<RecognizeCategorizedEntitiesResultArray>;\n /**\n * Runs a predictive model to identify a collection of named entities\n * in the passed-in input documents, and categorize those entities into types\n * such as person, location, or organization. For more information on\n * available categories, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types}.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input documents to analyze.\n * @param options - Optional parameters for the operation.\n */\n public async recognizeEntities(\n documents: TextDocumentInput[],\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: RecognizeCategorizedEntitiesOptions\n ): Promise<RecognizeCategorizedEntitiesResultArray>;\n public async recognizeEntities(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | RecognizeCategorizedEntitiesOptions,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: RecognizeCategorizedEntitiesOptions\n ): Promise<RecognizeCategorizedEntitiesResultArray> {\n let realOptions: RecognizeCategorizedEntitiesOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as RecognizeCategorizedEntitiesOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-recognizeEntities\",\n makeGeneratedRecognizeCategorizedEntitiesOptions(realOptions)\n );\n\n try {\n const result = await this.client.entitiesRecognitionGeneral(\n {\n documents: realInputs,\n },\n finalOptions\n );\n\n return makeRecognizeCategorizedEntitiesResultArray(realInputs, result);\n } catch (e) {\n /**\n * This special logic handles REST exception with code\n * InvalidDocumentBatch and is needed to maintain backward compatability\n * with sdk v5.0.0 and earlier. In general, REST exceptions are thrown as\n * is and include both outer and inner exception codes. However, the\n * earlier versions were throwing an exception that included the inner\n * code only.\n */\n const backwardCompatibleException = compileError(e);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: backwardCompatibleException.message,\n });\n throw backwardCompatibleException;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a predictive model to identify the positive, negative, neutral, or mixed\n * sentiment contained in the input strings, as well as scores indicating\n * the model's confidence in each of the predicted sentiments. Optionally it\n * can also identify targets in the text and assessments about it through\n * opinion mining. For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the lanuage is explicitly set to \"None\".\n * @param options - Optional parameters that includes enabling opinion mining.\n */\n public async analyzeSentiment(\n documents: string[],\n language?: string,\n options?: AnalyzeSentimentOptions\n ): Promise<AnalyzeSentimentResultArray>;\n /**\n * Runs a predictive model to identify the positive, negative or neutral, or mixed\n * sentiment contained in the input documents, as well as scores indicating\n * the model's confidence in each of the predicted sentiments.Optionally it\n * can also identify targets in the text and assessments about it through\n * opinion mining. For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input documents to analyze.\n * @param options - Optional parameters that includes enabling opinion mining.\n */\n public async analyzeSentiment(\n documents: TextDocumentInput[],\n options?: AnalyzeSentimentOptions\n ): Promise<AnalyzeSentimentResultArray>;\n public async analyzeSentiment(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | AnalyzeSentimentOptions,\n options?: AnalyzeSentimentOptions\n ): Promise<AnalyzeSentimentResultArray> {\n let realOptions: AnalyzeSentimentOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as AnalyzeSentimentOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-analyzeSentiment\",\n makeGeneratedAnalyzeSentimentOptions(realOptions)\n );\n\n try {\n const result = await this.client.sentiment(\n {\n documents: realInputs,\n },\n finalOptions\n );\n\n return makeAnalyzeSentimentResultArray(realInputs, result);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a model to identify a collection of significant phrases\n * found in the passed-in input strings.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n public async extractKeyPhrases(\n documents: string[],\n language?: string,\n options?: ExtractKeyPhrasesOptions\n ): Promise<ExtractKeyPhrasesResultArray>;\n /**\n * Runs a model to identify a collection of significant phrases\n * found in the passed-in input documents.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input documents to analyze.\n * @param options - Options for the operation.\n */\n public async extractKeyPhrases(\n documents: TextDocumentInput[],\n options?: ExtractKeyPhrasesOptions\n ): Promise<ExtractKeyPhrasesResultArray>;\n public async extractKeyPhrases(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | ExtractKeyPhrasesOptions,\n options?: ExtractKeyPhrasesOptions\n ): Promise<ExtractKeyPhrasesResultArray> {\n let realOptions: ExtractKeyPhrasesOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as ExtractKeyPhrasesOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-extractKeyPhrases\",\n makeGeneratedExtractKeyPhrasesOptions(realOptions)\n );\n\n try {\n const result = await this.client.keyPhrases(\n {\n documents: realInputs,\n },\n finalOptions\n );\n\n return makeExtractKeyPhrasesResultArray(realInputs, result);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a predictive model to identify a collection of entities containing\n * personally identifiable information found in the passed-in input strings,\n * and categorize those entities into types such as US social security\n * number, drivers license number, or credit card number.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support}.\n * @param inputs - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n public async recognizePiiEntities(\n inputs: string[],\n language?: string,\n options?: RecognizePiiEntitiesOptions\n ): Promise<RecognizePiiEntitiesResultArray>;\n /**\n * Runs a predictive model to identify a collection of entities containing\n * personally identifiable information found in the passed-in input documents,\n * and categorize those entities into types such as US social security\n * number, drivers license number, or credit card number.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support}.\n * @param inputs - The input documents to analyze.\n * @param options - Optional parameters for the operation.\n */\n public async recognizePiiEntities(\n inputs: TextDocumentInput[],\n options?: RecognizePiiEntitiesOptions\n ): Promise<RecognizePiiEntitiesResultArray>;\n public async recognizePiiEntities(\n inputs: string[] | TextDocumentInput[],\n languageOrOptions?: string | RecognizePiiEntitiesOptions,\n options?: RecognizePiiEntitiesOptions\n ): Promise<RecognizePiiEntitiesResultArray> {\n let realOptions: RecognizePiiEntitiesOptions;\n let realInputs: TextDocumentInput[];\n\n if (isStringArray(inputs)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(inputs, language);\n realOptions = options || {};\n } else {\n realInputs = inputs;\n realOptions = (languageOrOptions as RecognizePiiEntitiesOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-recognizePiiEntities\",\n makeGeneratedRecognizePiiEntitiesOptions(realOptions)\n );\n\n try {\n const result = await this.client.entitiesRecognitionPii(\n {\n documents: realInputs,\n },\n finalOptions\n );\n\n return makeRecognizePiiEntitiesResultArray(realInputs, result);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a predictive model to identify a collection of entities\n * found in the passed-in input strings, and include information linking the\n * entities to their corresponding entries in a well-known knowledge base.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n public async recognizeLinkedEntities(\n documents: string[],\n language?: string,\n options?: RecognizeLinkedEntitiesOptions\n ): Promise<RecognizeLinkedEntitiesResultArray>;\n /**\n * Runs a predictive model to identify a collection of entities\n * found in the passed-in input documents, and include information linking the\n * entities to their corresponding entries in a well-known knowledge base.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input documents to analyze.\n * @param options - Options for the operation.\n */\n public async recognizeLinkedEntities(\n documents: TextDocumentInput[],\n options?: RecognizeLinkedEntitiesOptions\n ): Promise<RecognizeLinkedEntitiesResultArray>;\n public async recognizeLinkedEntities(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | RecognizeLinkedEntitiesOptions,\n options?: RecognizeLinkedEntitiesOptions\n ): Promise<RecognizeLinkedEntitiesResultArray> {\n let realOptions: RecognizeLinkedEntitiesOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as RecognizeLinkedEntitiesOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-recognizeLinkedEntities\",\n makeGeneratedRecognizeLinkingEntitiesOptions(realOptions)\n );\n\n try {\n const result = await this.client.entitiesLinking(\n {\n documents: realInputs,\n },\n finalOptions\n );\n\n return makeRecognizeLinkedEntitiesResultArray(realInputs, result);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions,\n * symptoms, etc) and their relations.\n * @param documents - Collection of documents to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`.\n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n async beginAnalyzeHealthcareEntities(\n documents: string[],\n language?: string,\n options?: BeginAnalyzeHealthcareEntitiesOptions\n ): Promise<AnalyzeHealthcareEntitiesPollerLike>;\n /**\n * Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions,\n * symptoms, etc) and their relations.\n * @param documents - Collection of documents to analyze.\n * @param options - Options for the operation.\n */\n async beginAnalyzeHealthcareEntities(\n documents: TextDocumentInput[],\n options?: BeginAnalyzeHealthcareEntitiesOptions\n ): Promise<AnalyzeHealthcareEntitiesPollerLike>;\n\n async beginAnalyzeHealthcareEntities(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | BeginAnalyzeHealthcareEntitiesOptions,\n options?: BeginAnalyzeHealthcareEntitiesOptions\n ): Promise<AnalyzeHealthcareEntitiesPollerLike> {\n let realOptions: BeginAnalyzeHealthcareEntitiesOptions;\n let realInputs: TextDocumentInput[];\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as BeginAnalyzeHealthcareEntitiesOptions) || {};\n }\n\n const {\n updateIntervalInMs,\n resumeFrom,\n onResponse,\n disableServiceLogs,\n modelVersion,\n requestOptions,\n serializerOptions,\n abortSignal,\n stringIndexType,\n includeStatistics,\n tracingOptions,\n } = realOptions;\n const lro = new HealthLro(\n this.client,\n {\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions,\n },\n { loggingOptOut: disableServiceLogs, stringIndexType, modelVersion },\n { includeStatistics },\n realInputs\n );\n\n const poller = new LroEngine<\n PagedAnalyzeHealthcareEntitiesResult,\n AnalyzeHealthcareOperationState\n >(lro, {\n intervalInMs: updateIntervalInMs,\n resumeFrom: resumeFrom,\n processResult: processHealthResult(this.client, realInputs, {\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions,\n includeStatistics,\n }),\n isDone: isHealthDone,\n updateState: updateHealthState,\n });\n\n await poller.poll();\n return poller;\n }\n\n /**\n * Submit a collection of text documents for analysis. Specify one or more unique actions to be executed.\n * @param documents - Collection of documents to analyze\n * @param actions - TextAnalyticsActions to execute.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`.\n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n public async beginAnalyzeActions(\n documents: string[],\n actions: TextAnalyticsActions,\n language?: string,\n options?: BeginAnalyzeActionsOptions\n ): Promise<AnalyzeActionsPollerLike>;\n /**\n * Submit a collection of text documents for analysis. Specify one or more unique actions to be executed.\n * @param documents - Collection of documents to analyze\n * @param actions - TextAnalyticsActions to execute.\n * @param options - Options for the operation.\n */\n public async beginAnalyzeActions(\n documents: TextDocumentInput[],\n actions: TextAnalyticsActions,\n options?: BeginAnalyzeActionsOptions\n ): Promise<AnalyzeActionsPollerLike>;\n public async beginAnalyzeActions(\n documents: string[] | TextDocumentInput[],\n actions: TextAnalyticsActions,\n languageOrOptions?: string | BeginAnalyzeActionsOptions,\n options?: BeginAnalyzeActionsOptions\n ): Promise<AnalyzeActionsPollerLike> {\n let realOptions: BeginAnalyzeActionsOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as BeginAnalyzeActionsOptions) || {};\n }\n const compiledActions = compileAnalyzeInput(actions);\n const {\n updateIntervalInMs,\n resumeFrom,\n displayName,\n includeStatistics,\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions,\n } = realOptions;\n const lro = new AnalyzeLro(\n this.client,\n {\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions,\n },\n { displayName },\n { includeStatistics },\n realInputs,\n compiledActions\n );\n\n const poller = new LroEngine<PagedAnalyzeActionsResult, AnalyzeActionsOperationState>(lro, {\n intervalInMs: updateIntervalInMs,\n resumeFrom: resumeFrom,\n processResult: processAnalyzeResult(this.client, realInputs, {\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions,\n includeStatistics,\n }),\n updateState: updateAnalyzeState,\n });\n\n await poller.poll();\n return poller;\n }\n}\n\n/**\n * @internal\n */\nfunction compileAnalyzeInput(actions: TextAnalyticsActions): GeneratedActions {\n return {\n entityRecognitionPiiTasks: actions.recognizePiiEntitiesActions?.map(\n compose(setStrEncodingParam, compose(setCategoriesFilter, addParamsToTask))\n ),\n entityRecognitionTasks: actions.recognizeEntitiesActions?.map(\n compose(setStrEncodingParam, addParamsToTask)\n ),\n keyPhraseExtractionTasks: actions.extractKeyPhrasesActions?.map(addParamsToTask),\n entityLinkingTasks: actions.recognizeLinkedEntitiesActions?.map(\n compose(setStrEncodingParam, addParamsToTask)\n ),\n sentimentAnalysisTasks: actions.analyzeSentimentActions?.map(\n compose(setStrEncodingParam, compose(setOpinionMining, addParamsToTask))\n ),\n extractiveSummarizationTasks: actions.extractSummaryActions?.map(\n compose(setStrEncodingParam, compose(setSentenceCount, compose(setOrderBy, addParamsToTask)))\n ),\n customEntityRecognitionTasks: actions.recognizeCustomEntitiesActions?.map(\n compose(setStrEncodingParam, addParamsToTask)\n ),\n customSingleClassificationTasks: actions.singleCategoryClassifyActions?.map(addParamsToTask),\n customMultiClassificationTasks: actions.multiCategoryClassifyActions?.map(addParamsToTask),\n };\n}\n\nfunction isStringArray(documents: any[]): documents is string[] {\n return typeof documents[0] === \"string\";\n}\n\n/**\n * @internal\n */\nfunction convertToDetectLanguageInput(\n inputs: string[],\n countryHint: string\n): DetectLanguageInput[] {\n if (countryHint === \"none\") {\n countryHint = \"\";\n }\n return inputs.map((text: string, index): DetectLanguageInput => {\n return {\n id: String(index),\n countryHint,\n text,\n };\n });\n}\n\n/**\n * @internal\n */\nfunction convertToTextDocumentInput(inputs: string[], language: string): TextDocumentInput[] {\n return inputs.map((text: string, index): TextDocumentInput => {\n return {\n id: String(index),\n language,\n text,\n };\n });\n}\n\n/**\n * Creates the options the service expects for the analyze sentiment API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedAnalyzeSentimentOptions(\n params: AnalyzeSentimentOptions\n): GeneratedAnalyzeSentimentOptions {\n return {\n abortSignal: params.abortSignal,\n opinionMining: params.includeOpinionMining,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n stringIndexType: setStrEncodingParamValue(params.stringIndexType),\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs,\n };\n}\n\n/**\n * Creates the options the service expects for the recognize pii entities API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedRecognizePiiEntitiesOptions(\n params: RecognizePiiEntitiesOptions\n): GeneratedRecognizePiiEntitiesOptions {\n return {\n abortSignal: params.abortSignal,\n domain: params.domainFilter,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n stringIndexType: setStrEncodingParamValue(params.stringIndexType),\n tracingOptions: params.tracingOptions,\n piiCategories: params.categoriesFilter,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs,\n };\n}\n\n/**\n * Creates the options the service expects for the recognize entities API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedRecognizeCategorizedEntitiesOptions(\n params: RecognizeCategorizedEntitiesOptions\n): GeneratedRecognizeCategorizedEntitiesOptions {\n return {\n abortSignal: params.abortSignal,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n stringIndexType: setStrEncodingParamValue(params.stringIndexType),\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs,\n };\n}\n\n/**\n * Creates the options the service expects for the detect language API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedDetectLanguageOptions(\n params: DetectLanguageOptions\n): GeneratedDetectLanguageOptions {\n return {\n abortSignal: params.abortSignal,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs,\n };\n}\n\n/**\n * Creates the options the service expects for the extract key phrases API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedExtractKeyPhrasesOptions(\n params: ExtractKeyPhrasesOptions\n): GeneratedExtractKeyPhrasesOptions {\n return {\n abortSignal: params.abortSignal,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs,\n };\n}\n\n/**\n * Creates the options the service expects for the recognize linked entities API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedRecognizeLinkingEntitiesOptions(\n params: RecognizeLinkedEntitiesOptions\n): GeneratedRecognizeLinkedEntitiesOptions {\n return {\n abortSignal: params.abortSignal,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs,\n stringIndexType: setStrEncodingParamValue(params.stringIndexType),\n };\n}\n"]}
1
+ {"version":3,"file":"textAnalyticsClient.js","sourceRoot":"","sources":["../../src/textAnalyticsClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EAEL,+BAA+B,GAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAkC,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAalC,OAAO,EAEL,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,2CAA2C,GAC5C,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAEL,+BAA+B,GAChC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gCAAgC,GAEjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,mCAAmC,GACpC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,sCAAsC,GACvC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,qCAAqC,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EACL,eAAe,EACf,OAAO,EACP,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,GAEzB,MAAM,QAAQ,CAAC;AAIhB,OAAO,EAIL,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM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zC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,4CAA4C,CACnD,MAAsC;IAEtC,OAAO;QACL,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;QAC3C,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;QAC3C,aAAa,EAAE,MAAM,CAAC,kBAAkB;QACxC,eAAe,EAAE,wBAAwB,CAAC,MAAM,CAAC,eAAe,CAAC;KAClE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommonClientOptions } from \"@azure/core-client\";\nimport {\n InternalPipelineOptions,\n bearerTokenAuthenticationPolicy,\n} from \"@azure/core-rest-pipeline\";\nimport { TokenCredential, KeyCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { GeneratedClient } from \"./generated/generatedClient\";\nimport { logger } from \"./logger\";\nimport {\n JobManifestTasks as GeneratedActions,\n DetectLanguageInput,\n GeneratedClientEntitiesRecognitionPiiOptionalParams as GeneratedRecognizePiiEntitiesOptions,\n GeneratedClientSentimentOptionalParams as GeneratedAnalyzeSentimentOptions,\n GeneratedClientEntitiesRecognitionGeneralOptionalParams as GeneratedRecognizeCategorizedEntitiesOptions,\n GeneratedClientEntitiesLinkingOptionalParams as GeneratedRecognizeLinkedEntitiesOptions,\n GeneratedClientKeyPhrasesOptionalParams as GeneratedExtractKeyPhrasesOptions,\n GeneratedClientLanguagesOptionalParams as GeneratedDetectLanguageOptions,\n TextDocumentInput,\n PiiCategory,\n} from \"./generated/models\";\nimport {\n DetectLanguageResultArray,\n makeDetectLanguageResultArray,\n} from \"./detectLanguageResultArray\";\nimport {\n RecognizeCategorizedEntitiesResultArray,\n makeRecognizeCategorizedEntitiesResultArray,\n} from \"./recognizeCategorizedEntitiesResultArray\";\nimport {\n AnalyzeSentimentResultArray,\n makeAnalyzeSentimentResultArray,\n} from \"./analyzeSentimentResultArray\";\nimport {\n makeExtractKeyPhrasesResultArray,\n ExtractKeyPhrasesResultArray,\n} from \"./extractKeyPhrasesResultArray\";\nimport {\n RecognizePiiEntitiesResultArray,\n makeRecognizePiiEntitiesResultArray,\n} from \"./recognizePiiEntitiesResultArray\";\nimport {\n RecognizeLinkedEntitiesResultArray,\n makeRecognizeLinkedEntitiesResultArray,\n} from \"./recognizeLinkedEntitiesResultArray\";\nimport { createSpan } from \"./tracing\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport { textAnalyticsAzureKeyCredentialPolicy } from \"./azureKeyCredentialPolicy\";\nimport {\n addParamsToTask,\n compose,\n compileError,\n setCategoriesFilter,\n setOpinionMining,\n setOrderBy,\n setSentenceCount,\n setStrEncodingParam,\n setStrEncodingParamValue,\n StringIndexType,\n} from \"./util\";\nimport { TextAnalyticsOperationOptions } from \"./textAnalyticsOperationOptions\";\nimport { AnalysisPollOperationState, OperationMetadata } from \"./pollerModels\";\nimport { CustomTextAnalyticsAction, TextAnalyticsAction } from \"./textAnalyticsAction\";\nimport {\n AnalyzeHealthcareEntitiesPollerLike,\n AnalyzeHealthcareOperationState,\n BeginAnalyzeHealthcareEntitiesOptions,\n HealthLro,\n isHealthDone,\n processHealthResult,\n updateHealthState,\n} from \"./healthLro\";\nimport { LroEngine } from \"@azure/core-lro\";\nimport { PagedAnalyzeHealthcareEntitiesResult } from \"./analyzeHealthcareEntitiesResult\";\nimport {\n AnalyzeActionsOperationMetadata,\n AnalyzeActionsOperationState,\n AnalyzeActionsPollerLike,\n AnalyzeLro,\n BeginAnalyzeActionsOptions,\n processAnalyzeResult,\n updateAnalyzeState,\n} from \"./analyzeLro\";\nimport { PagedAnalyzeActionsResult } from \"./analyzeActionsResult\";\n\nexport {\n BeginAnalyzeActionsOptions,\n AnalyzeActionsPollerLike,\n AnalyzeActionsOperationState,\n BeginAnalyzeHealthcareEntitiesOptions,\n AnalyzeHealthcareEntitiesPollerLike,\n AnalyzeHealthcareOperationState,\n AnalysisPollOperationState,\n OperationMetadata,\n AnalyzeActionsOperationMetadata,\n StringIndexType,\n};\n\nconst DEFAULT_COGNITIVE_SCOPE = \"https://cognitiveservices.azure.com/.default\";\n\n/**\n * Client options used to configure TextAnalytics API requests.\n */\nexport interface TextAnalyticsClientOptions extends CommonClientOptions {\n /**\n * The default country hint to use. Defaults to \"us\".\n */\n defaultCountryHint?: string;\n\n /**\n * The default language to use. Defaults to \"en\".\n */\n defaultLanguage?: string;\n}\n\n/**\n * Options for the detect languages operation.\n */\nexport interface DetectLanguageOptions extends TextAnalyticsOperationOptions {}\n\n/**\n * Options for the recognize entities operation.\n */\nexport interface RecognizeCategorizedEntitiesOptions extends TextAnalyticsOperationOptions {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n}\n\n/**\n * Options for the analyze sentiment operation.\n */\nexport interface AnalyzeSentimentOptions extends TextAnalyticsOperationOptions {\n /**\n * Whether to mine the opinions of a sentence and conduct more granular\n * analysis around the aspects of a product or service (also known as\n * aspect-based sentiment analysis). If set to true, the returned\n * `SentenceSentiment` objects will have property `opinions` containing\n * the result of this analysis.\n * More information about the feature can be found here: {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis?tabs=version-3-1#opinion-mining}\n */\n includeOpinionMining?: boolean;\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n}\n\n/**\n * The types of PII domains the user can choose from.\n */\nexport enum PiiEntityDomain {\n /**\n * @see {@link https://aka.ms/tanerpii} for more information.\n */\n PROTECTED_HEALTH_INFORMATION = \"PHI\",\n}\n\n/**\n * Options for the recognize PII entities operation.\n */\nexport interface RecognizePiiEntitiesOptions extends TextAnalyticsOperationOptions {\n /**\n * Filters entities to ones only included in the specified domain (e.g., if\n * set to 'PHI', entities in the Protected Healthcare Information domain will\n * only be returned). @see {@link https://aka.ms/tanerpii} for more information.\n */\n domainFilter?: PiiEntityDomain;\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * Filters entities to ones only included in the specified array of categories\n */\n categoriesFilter?: PiiCategory[];\n}\n\n/**\n * Options for the extract key phrases operation.\n */\nexport interface ExtractKeyPhrasesOptions extends TextAnalyticsOperationOptions {}\n\n/**\n * Options for the recognize linked entities operation.\n */\nexport interface RecognizeLinkedEntitiesOptions extends TextAnalyticsOperationOptions {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n}\n\n/**\n * Options for an entities recognition action.\n */\nexport interface RecognizeCategorizedEntitiesAction extends TextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for a Pii entities recognition action.\n */\nexport interface RecognizePiiEntitiesAction extends TextAnalyticsAction {\n /**\n * Filters entities to ones only included in the specified domain (e.g., if\n * set to 'PHI', entities in the Protected Healthcare Information domain will\n * only be returned). @see {@link https://aka.ms/tanerpii} for more information.\n */\n domainFilter?: PiiEntityDomain;\n /**\n * Filters entities to ones only included in the specified array of categories\n */\n categoriesFilter?: PiiCategory[];\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to false, you opt-in to have your text input logged for troubleshooting. By default, Text Analytics\n * will not log your input text for pii entities recognition. Setting this parameter to false,\n * enables input logging.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for a key phrases recognition action.\n */\nexport interface ExtractKeyPhrasesAction extends TextAnalyticsAction {\n /**\n * If set to false, you opt-in to have your text input logged for troubleshooting. By default, Text Analytics\n * will not log your input text for pii entities recognition. Setting this parameter to false,\n * enables input logging.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for an entities linking action.\n */\nexport interface RecognizeLinkedEntitiesAction extends TextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for an analyze sentiment action.\n */\nexport interface AnalyzeSentimentAction extends TextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n /**\n * Whether to mine the opinions of a sentence and conduct more granular\n * analysis around the aspects of a product or service (also known as\n * aspect-based sentiment analysis). If set to true, the returned\n * `SentenceSentiment` objects will have property `opinions` containing\n * the result of this analysis.\n * More information about the feature can be found here: {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis?tabs=version-3-1#opinion-mining}\n */\n includeOpinionMining?: boolean;\n}\n\n/**\n * A type representing how to sort sentences for the summarization extraction action.\n */\nexport type KnownSummarySentencesSortBy = \"Offset\" | \"Rank\";\n\n/**\n * Options for an extract summary action.\n */\nexport interface ExtractSummaryAction extends TextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n /**\n * Specifies the number of summary sentences to return. The default number of sentences is 3.\n */\n maxSentenceCount?: number;\n /**\n * Specifies how to sort the returned sentences. Please refer to {@link KnownSummarySentencesOrderBy} for possible values.\n */\n orderBy?: string;\n}\n\n/**\n * Options for a custom recognize entities action. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customentityrecognition}\n */\nexport interface RecognizeCustomEntitiesAction extends CustomTextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for an custom classify document single category action. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}\n */\nexport interface SingleCategoryClassifyAction extends CustomTextAnalyticsAction {\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for a custom classify document multi categories action. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}\n */\nexport interface MultiCategoryClassifyAction extends CustomTextAnalyticsAction {\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Description of collection of actions for the analyze API to perform on input documents.\n */\nexport interface TextAnalyticsActions {\n /**\n * A collection of descriptions of entities recognition actions.\n */\n recognizeEntitiesActions?: RecognizeCategorizedEntitiesAction[];\n /**\n * A collection of descriptions of Pii entities recognition actions.\n */\n recognizePiiEntitiesActions?: RecognizePiiEntitiesAction[];\n /**\n * A collection of descriptions of key phrases recognition actions.\n */\n extractKeyPhrasesActions?: ExtractKeyPhrasesAction[];\n /**\n * A collection of descriptions of entities linking actions.\n */\n recognizeLinkedEntitiesActions?: RecognizeLinkedEntitiesAction[];\n /**\n * A collection of descriptions of sentiment analysis actions.\n */\n analyzeSentimentActions?: AnalyzeSentimentAction[];\n /**\n * A collection of descriptions of summarization extraction actions.\n */\n extractSummaryActions?: ExtractSummaryAction[];\n /**\n * A collection of descriptions of custom entity recognition actions. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customentityrecognition}\n */\n recognizeCustomEntitiesActions?: RecognizeCustomEntitiesAction[];\n /**\n * A collection of descriptions of custom single classification actions. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}\n */\n singleCategoryClassifyActions?: SingleCategoryClassifyAction[];\n /**\n * A collection of descriptions of custom multi classification actions. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}\n */\n multiCategoryClassifyActions?: MultiCategoryClassifyAction[];\n}\n/**\n * Client class for interacting with Azure Text Analytics.\n */\nexport class TextAnalyticsClient {\n /**\n * The URL to the TextAnalytics endpoint\n */\n public readonly endpointUrl: string;\n\n /**\n * The default country hint to use. Defaults to \"us\".\n */\n public defaultCountryHint: string;\n\n /**\n * The default language to use. Defaults to \"en\".\n */\n public defaultLanguage: string;\n\n /**\n * @internal\n * A reference to the auto-generated TextAnalytics HTTP client.\n */\n private readonly client: GeneratedClient;\n\n /**\n * Creates an instance of TextAnalyticsClient.\n *\n * Example usage:\n * ```ts\n * import { TextAnalyticsClient, AzureKeyCredential } from \"@azure/ai-text-analytics\";\n *\n * const client = new TextAnalyticsClient(\n * \"<service endpoint>\",\n * new AzureKeyCredential(\"<api key>\")\n * );\n * ```\n * @param endpointUrl - The URL to the TextAnalytics endpoint\n * @param credential - Used to authenticate requests to the service.\n * @param options - Used to configure the TextAnalytics client.\n */\n constructor(\n endpointUrl: string,\n credential: TokenCredential | KeyCredential,\n options: TextAnalyticsClientOptions = {}\n ) {\n this.endpointUrl = endpointUrl;\n const { defaultCountryHint = \"us\", defaultLanguage = \"en\", ...pipelineOptions } = options;\n this.defaultCountryHint = defaultCountryHint;\n this.defaultLanguage = defaultLanguage;\n\n const internalPipelineOptions: InternalPipelineOptions = {\n ...pipelineOptions,\n ...{\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\"x-ms-correlation-request-id\", \"x-ms-request-id\"],\n },\n },\n };\n\n this.client = new GeneratedClient(this.endpointUrl, internalPipelineOptions);\n\n const authPolicy = isTokenCredential(credential)\n ? bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_COGNITIVE_SCOPE })\n : textAnalyticsAzureKeyCredentialPolicy(credential);\n\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Runs a predictive model to determine the language that the passed-in\n * input strings are written in, and returns, for each one, the detected\n * language as well as a score indicating the model's confidence that the\n * inferred language is correct. Scores close to 1 indicate high certainty in\n * the result. 120 languages are supported.\n * @param documents - A collection of input strings to analyze.\n * @param countryHint - Indicates the country of origin for all of\n * the input strings to assist the text analytics model in predicting\n * the language they are written in. If unspecified, this value will be\n * set to the default country hint in `TextAnalyticsClientOptions`.\n * If set to an empty string, or the string \"none\", the service will apply a\n * model where the country is explicitly unset.\n * The same country hint is applied to all strings in the input collection.\n * @param options - Optional parameters for the operation.\n */\n public async detectLanguage(\n documents: string[],\n countryHint?: string,\n options?: DetectLanguageOptions\n ): Promise<DetectLanguageResultArray>;\n /**\n * Runs a predictive model to determine the language that the passed-in\n * input document are written in, and returns, for each one, the detected\n * language as well as a score indicating the model's confidence that the\n * inferred language is correct. Scores close to 1 indicate high certainty in\n * the result. 120 languages are supported.\n * @param documents - A collection of input documents to analyze.\n * @param options - Optional parameters for the operation.\n */\n public async detectLanguage(\n documents: DetectLanguageInput[],\n options?: DetectLanguageOptions\n ): Promise<DetectLanguageResultArray>;\n public async detectLanguage(\n documents: string[] | DetectLanguageInput[],\n countryHintOrOptions?: string | DetectLanguageOptions,\n options?: DetectLanguageOptions\n ): Promise<DetectLanguageResultArray> {\n let realOptions: DetectLanguageOptions;\n let realInputs: DetectLanguageInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const countryHint = (countryHintOrOptions as string) || this.defaultCountryHint;\n realInputs = convertToDetectLanguageInput(documents, countryHint);\n realOptions = options || {};\n } else {\n // Replace \"none\" hints with \"\"\n realInputs = documents.map((input) => ({\n ...input,\n countryHint: input.countryHint === \"none\" ? \"\" : input.countryHint,\n }));\n realOptions = (countryHintOrOptions as DetectLanguageOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-detectLanguages\",\n makeGeneratedDetectLanguageOptions(realOptions)\n );\n\n try {\n const result = await this.client.languages(\n {\n documents: realInputs,\n },\n finalOptions\n );\n\n return makeDetectLanguageResultArray(realInputs, result);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a predictive model to identify a collection of named entities\n * in the passed-in input strings, and categorize those entities into types\n * such as person, location, or organization. For more information on \n * available categories, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types}.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Optional parameters for the operation.\n */\n public async recognizeEntities(\n documents: string[],\n language?: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: RecognizeCategorizedEntitiesOptions\n ): Promise<RecognizeCategorizedEntitiesResultArray>;\n /**\n * Runs a predictive model to identify a collection of named entities\n * in the passed-in input documents, and categorize those entities into types\n * such as person, location, or organization. For more information on\n * available categories, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types}.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input documents to analyze.\n * @param options - Optional parameters for the operation.\n */\n public async recognizeEntities(\n documents: TextDocumentInput[],\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: RecognizeCategorizedEntitiesOptions\n ): Promise<RecognizeCategorizedEntitiesResultArray>;\n public async recognizeEntities(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | RecognizeCategorizedEntitiesOptions,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: RecognizeCategorizedEntitiesOptions\n ): Promise<RecognizeCategorizedEntitiesResultArray> {\n let realOptions: RecognizeCategorizedEntitiesOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as RecognizeCategorizedEntitiesOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-recognizeEntities\",\n makeGeneratedRecognizeCategorizedEntitiesOptions(realOptions)\n );\n\n try {\n const result = await this.client.entitiesRecognitionGeneral(\n {\n documents: realInputs,\n },\n finalOptions\n );\n\n return makeRecognizeCategorizedEntitiesResultArray(realInputs, result);\n } catch (e: any) {\n /**\n * This special logic handles REST exception with code\n * InvalidDocumentBatch and is needed to maintain backward compatability\n * with sdk v5.0.0 and earlier. In general, REST exceptions are thrown as\n * is and include both outer and inner exception codes. However, the\n * earlier versions were throwing an exception that included the inner\n * code only.\n */\n const backwardCompatibleException = compileError(e);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: backwardCompatibleException.message,\n });\n throw backwardCompatibleException;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a predictive model to identify the positive, negative, neutral, or mixed\n * sentiment contained in the input strings, as well as scores indicating\n * the model's confidence in each of the predicted sentiments. Optionally it\n * can also identify targets in the text and assessments about it through\n * opinion mining. For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the lanuage is explicitly set to \"None\".\n * @param options - Optional parameters that includes enabling opinion mining.\n */\n public async analyzeSentiment(\n documents: string[],\n language?: string,\n options?: AnalyzeSentimentOptions\n ): Promise<AnalyzeSentimentResultArray>;\n /**\n * Runs a predictive model to identify the positive, negative or neutral, or mixed\n * sentiment contained in the input documents, as well as scores indicating\n * the model's confidence in each of the predicted sentiments.Optionally it\n * can also identify targets in the text and assessments about it through\n * opinion mining. For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input documents to analyze.\n * @param options - Optional parameters that includes enabling opinion mining.\n */\n public async analyzeSentiment(\n documents: TextDocumentInput[],\n options?: AnalyzeSentimentOptions\n ): Promise<AnalyzeSentimentResultArray>;\n public async analyzeSentiment(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | AnalyzeSentimentOptions,\n options?: AnalyzeSentimentOptions\n ): Promise<AnalyzeSentimentResultArray> {\n let realOptions: AnalyzeSentimentOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as AnalyzeSentimentOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-analyzeSentiment\",\n makeGeneratedAnalyzeSentimentOptions(realOptions)\n );\n\n try {\n const result = await this.client.sentiment(\n {\n documents: realInputs,\n },\n finalOptions\n );\n\n return makeAnalyzeSentimentResultArray(realInputs, result);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a model to identify a collection of significant phrases\n * found in the passed-in input strings.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n public async extractKeyPhrases(\n documents: string[],\n language?: string,\n options?: ExtractKeyPhrasesOptions\n ): Promise<ExtractKeyPhrasesResultArray>;\n /**\n * Runs a model to identify a collection of significant phrases\n * found in the passed-in input documents.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input documents to analyze.\n * @param options - Options for the operation.\n */\n public async extractKeyPhrases(\n documents: TextDocumentInput[],\n options?: ExtractKeyPhrasesOptions\n ): Promise<ExtractKeyPhrasesResultArray>;\n public async extractKeyPhrases(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | ExtractKeyPhrasesOptions,\n options?: ExtractKeyPhrasesOptions\n ): Promise<ExtractKeyPhrasesResultArray> {\n let realOptions: ExtractKeyPhrasesOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as ExtractKeyPhrasesOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-extractKeyPhrases\",\n makeGeneratedExtractKeyPhrasesOptions(realOptions)\n );\n\n try {\n const result = await this.client.keyPhrases(\n {\n documents: realInputs,\n },\n finalOptions\n );\n\n return makeExtractKeyPhrasesResultArray(realInputs, result);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a predictive model to identify a collection of entities containing\n * personally identifiable information found in the passed-in input strings,\n * and categorize those entities into types such as US social security\n * number, drivers license number, or credit card number.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support}.\n * @param inputs - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n public async recognizePiiEntities(\n inputs: string[],\n language?: string,\n options?: RecognizePiiEntitiesOptions\n ): Promise<RecognizePiiEntitiesResultArray>;\n /**\n * Runs a predictive model to identify a collection of entities containing\n * personally identifiable information found in the passed-in input documents,\n * and categorize those entities into types such as US social security\n * number, drivers license number, or credit card number.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support}.\n * @param inputs - The input documents to analyze.\n * @param options - Optional parameters for the operation.\n */\n public async recognizePiiEntities(\n inputs: TextDocumentInput[],\n options?: RecognizePiiEntitiesOptions\n ): Promise<RecognizePiiEntitiesResultArray>;\n public async recognizePiiEntities(\n inputs: string[] | TextDocumentInput[],\n languageOrOptions?: string | RecognizePiiEntitiesOptions,\n options?: RecognizePiiEntitiesOptions\n ): Promise<RecognizePiiEntitiesResultArray> {\n let realOptions: RecognizePiiEntitiesOptions;\n let realInputs: TextDocumentInput[];\n\n if (isStringArray(inputs)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(inputs, language);\n realOptions = options || {};\n } else {\n realInputs = inputs;\n realOptions = (languageOrOptions as RecognizePiiEntitiesOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-recognizePiiEntities\",\n makeGeneratedRecognizePiiEntitiesOptions(realOptions)\n );\n\n try {\n const result = await this.client.entitiesRecognitionPii(\n {\n documents: realInputs,\n },\n finalOptions\n );\n\n return makeRecognizePiiEntitiesResultArray(realInputs, result);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a predictive model to identify a collection of entities\n * found in the passed-in input strings, and include information linking the\n * entities to their corresponding entries in a well-known knowledge base.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n public async recognizeLinkedEntities(\n documents: string[],\n language?: string,\n options?: RecognizeLinkedEntitiesOptions\n ): Promise<RecognizeLinkedEntitiesResultArray>;\n /**\n * Runs a predictive model to identify a collection of entities\n * found in the passed-in input documents, and include information linking the\n * entities to their corresponding entries in a well-known knowledge base.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input documents to analyze.\n * @param options - Options for the operation.\n */\n public async recognizeLinkedEntities(\n documents: TextDocumentInput[],\n options?: RecognizeLinkedEntitiesOptions\n ): Promise<RecognizeLinkedEntitiesResultArray>;\n public async recognizeLinkedEntities(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | RecognizeLinkedEntitiesOptions,\n options?: RecognizeLinkedEntitiesOptions\n ): Promise<RecognizeLinkedEntitiesResultArray> {\n let realOptions: RecognizeLinkedEntitiesOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as RecognizeLinkedEntitiesOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-recognizeLinkedEntities\",\n makeGeneratedRecognizeLinkingEntitiesOptions(realOptions)\n );\n\n try {\n const result = await this.client.entitiesLinking(\n {\n documents: realInputs,\n },\n finalOptions\n );\n\n return makeRecognizeLinkedEntitiesResultArray(realInputs, result);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions,\n * symptoms, etc) and their relations.\n * @param documents - Collection of documents to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`.\n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n async beginAnalyzeHealthcareEntities(\n documents: string[],\n language?: string,\n options?: BeginAnalyzeHealthcareEntitiesOptions\n ): Promise<AnalyzeHealthcareEntitiesPollerLike>;\n /**\n * Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions,\n * symptoms, etc) and their relations.\n * @param documents - Collection of documents to analyze.\n * @param options - Options for the operation.\n */\n async beginAnalyzeHealthcareEntities(\n documents: TextDocumentInput[],\n options?: BeginAnalyzeHealthcareEntitiesOptions\n ): Promise<AnalyzeHealthcareEntitiesPollerLike>;\n\n async beginAnalyzeHealthcareEntities(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | BeginAnalyzeHealthcareEntitiesOptions,\n options?: BeginAnalyzeHealthcareEntitiesOptions\n ): Promise<AnalyzeHealthcareEntitiesPollerLike> {\n let realOptions: BeginAnalyzeHealthcareEntitiesOptions;\n let realInputs: TextDocumentInput[];\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as BeginAnalyzeHealthcareEntitiesOptions) || {};\n }\n\n const {\n updateIntervalInMs,\n resumeFrom,\n onResponse,\n disableServiceLogs,\n modelVersion,\n requestOptions,\n serializerOptions,\n abortSignal,\n stringIndexType,\n includeStatistics,\n tracingOptions,\n } = realOptions;\n const lro = new HealthLro(\n this.client,\n {\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions,\n },\n { loggingOptOut: disableServiceLogs, stringIndexType, modelVersion },\n { includeStatistics },\n realInputs\n );\n\n const poller = new LroEngine<\n PagedAnalyzeHealthcareEntitiesResult,\n AnalyzeHealthcareOperationState\n >(lro, {\n intervalInMs: updateIntervalInMs,\n resumeFrom: resumeFrom,\n processResult: processHealthResult(this.client, realInputs, {\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions,\n includeStatistics,\n }),\n isDone: isHealthDone,\n updateState: updateHealthState,\n });\n\n await poller.poll();\n return poller;\n }\n\n /**\n * Submit a collection of text documents for analysis. Specify one or more unique actions to be executed.\n * @param documents - Collection of documents to analyze\n * @param actions - TextAnalyticsActions to execute.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`.\n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n public async beginAnalyzeActions(\n documents: string[],\n actions: TextAnalyticsActions,\n language?: string,\n options?: BeginAnalyzeActionsOptions\n ): Promise<AnalyzeActionsPollerLike>;\n /**\n * Submit a collection of text documents for analysis. Specify one or more unique actions to be executed.\n * @param documents - Collection of documents to analyze\n * @param actions - TextAnalyticsActions to execute.\n * @param options - Options for the operation.\n */\n public async beginAnalyzeActions(\n documents: TextDocumentInput[],\n actions: TextAnalyticsActions,\n options?: BeginAnalyzeActionsOptions\n ): Promise<AnalyzeActionsPollerLike>;\n public async beginAnalyzeActions(\n documents: string[] | TextDocumentInput[],\n actions: TextAnalyticsActions,\n languageOrOptions?: string | BeginAnalyzeActionsOptions,\n options?: BeginAnalyzeActionsOptions\n ): Promise<AnalyzeActionsPollerLike> {\n let realOptions: BeginAnalyzeActionsOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as BeginAnalyzeActionsOptions) || {};\n }\n const compiledActions = compileAnalyzeInput(actions);\n const {\n updateIntervalInMs,\n resumeFrom,\n displayName,\n includeStatistics,\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions,\n } = realOptions;\n const lro = new AnalyzeLro(\n this.client,\n {\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions,\n },\n { displayName },\n { includeStatistics },\n realInputs,\n compiledActions\n );\n\n const poller = new LroEngine<PagedAnalyzeActionsResult, AnalyzeActionsOperationState>(lro, {\n intervalInMs: updateIntervalInMs,\n resumeFrom: resumeFrom,\n processResult: processAnalyzeResult(this.client, realInputs, {\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions,\n includeStatistics,\n }),\n updateState: updateAnalyzeState,\n });\n\n await poller.poll();\n return poller;\n }\n}\n\n/**\n * @internal\n */\nfunction compileAnalyzeInput(actions: TextAnalyticsActions): GeneratedActions {\n return {\n entityRecognitionPiiTasks: actions.recognizePiiEntitiesActions?.map(\n compose(setStrEncodingParam, compose(setCategoriesFilter, addParamsToTask))\n ),\n entityRecognitionTasks: actions.recognizeEntitiesActions?.map(\n compose(setStrEncodingParam, addParamsToTask)\n ),\n keyPhraseExtractionTasks: actions.extractKeyPhrasesActions?.map(addParamsToTask),\n entityLinkingTasks: actions.recognizeLinkedEntitiesActions?.map(\n compose(setStrEncodingParam, addParamsToTask)\n ),\n sentimentAnalysisTasks: actions.analyzeSentimentActions?.map(\n compose(setStrEncodingParam, compose(setOpinionMining, addParamsToTask))\n ),\n extractiveSummarizationTasks: actions.extractSummaryActions?.map(\n compose(setStrEncodingParam, compose(setSentenceCount, compose(setOrderBy, addParamsToTask)))\n ),\n customEntityRecognitionTasks: actions.recognizeCustomEntitiesActions?.map(\n compose(setStrEncodingParam, addParamsToTask)\n ),\n customSingleClassificationTasks: actions.singleCategoryClassifyActions?.map(addParamsToTask),\n customMultiClassificationTasks: actions.multiCategoryClassifyActions?.map(addParamsToTask),\n };\n}\n\nfunction isStringArray(documents: any[]): documents is string[] {\n return typeof documents[0] === \"string\";\n}\n\n/**\n * @internal\n */\nfunction convertToDetectLanguageInput(\n inputs: string[],\n countryHint: string\n): DetectLanguageInput[] {\n if (countryHint === \"none\") {\n countryHint = \"\";\n }\n return inputs.map((text: string, index): DetectLanguageInput => {\n return {\n id: String(index),\n countryHint,\n text,\n };\n });\n}\n\n/**\n * @internal\n */\nfunction convertToTextDocumentInput(inputs: string[], language: string): TextDocumentInput[] {\n return inputs.map((text: string, index): TextDocumentInput => {\n return {\n id: String(index),\n language,\n text,\n };\n });\n}\n\n/**\n * Creates the options the service expects for the analyze sentiment API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedAnalyzeSentimentOptions(\n params: AnalyzeSentimentOptions\n): GeneratedAnalyzeSentimentOptions {\n return {\n abortSignal: params.abortSignal,\n opinionMining: params.includeOpinionMining,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n stringIndexType: setStrEncodingParamValue(params.stringIndexType),\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs,\n };\n}\n\n/**\n * Creates the options the service expects for the recognize pii entities API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedRecognizePiiEntitiesOptions(\n params: RecognizePiiEntitiesOptions\n): GeneratedRecognizePiiEntitiesOptions {\n return {\n abortSignal: params.abortSignal,\n domain: params.domainFilter,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n stringIndexType: setStrEncodingParamValue(params.stringIndexType),\n tracingOptions: params.tracingOptions,\n piiCategories: params.categoriesFilter,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs,\n };\n}\n\n/**\n * Creates the options the service expects for the recognize entities API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedRecognizeCategorizedEntitiesOptions(\n params: RecognizeCategorizedEntitiesOptions\n): GeneratedRecognizeCategorizedEntitiesOptions {\n return {\n abortSignal: params.abortSignal,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n stringIndexType: setStrEncodingParamValue(params.stringIndexType),\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs,\n };\n}\n\n/**\n * Creates the options the service expects for the detect language API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedDetectLanguageOptions(\n params: DetectLanguageOptions\n): GeneratedDetectLanguageOptions {\n return {\n abortSignal: params.abortSignal,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs,\n };\n}\n\n/**\n * Creates the options the service expects for the extract key phrases API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedExtractKeyPhrasesOptions(\n params: ExtractKeyPhrasesOptions\n): GeneratedExtractKeyPhrasesOptions {\n return {\n abortSignal: params.abortSignal,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs,\n };\n}\n\n/**\n * Creates the options the service expects for the recognize linked entities API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedRecognizeLinkingEntitiesOptions(\n params: RecognizeLinkedEntitiesOptions\n): GeneratedRecognizeLinkedEntitiesOptions {\n return {\n abortSignal: params.abortSignal,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs,\n stringIndexType: setStrEncodingParamValue(params.stringIndexType),\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AASlC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAOvC;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACnC,WAAgB,EAChB,aAAkB;IAElB,MAAM,WAAW,GAAG,IAAI,GAAG,EAAa,CAAC;IACzC,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE;QAChC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;KAChC;IAED,IAAI,aAAa,CAAC,MAAM,KAAK,WAAW,CAAC,MAAM,EAAE;QAC/C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AC,YAAY,EAAE,EAAE,CACf,MAAM,CAAC,oBAAoB,CACzB,EAAE,OAAO,EAAE,YAAY,EAAE,kCAEpB,IAAI,KACP,IAAI,EACJ,UAAU,EAAE,KAAK,IAEpB,EACH,YAAY,CACb,CAAC;QACF,OAAO;YACL,YAAY,EAAE,YAAY;YAC1B,WAAW;SACZ,CAAC;KACH;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,SAAS,CAAC;YACb,IAAI,EAAE,cAAc,CAAC,KAAK;YAC1B,OAAO,EAAE,CAAC,CAAC,OAAO;SACnB,CAAC,CAAC;QACH,MAAM,CAAC,CAAC;KACT;YAAS;QACR,IAAI,CAAC,GAAG,EAAE,CAAC;KACZ;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { FullOperationResponse, OperationOptions, OperationSpec } from \"@azure/core-client\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport { logger } from \"./logger\";\nimport {\n ErrorResponse,\n GeneratedClient,\n InnerError,\n StringIndexType as GeneratedStringIndexType,\n TextAnalyticsError,\n} from \"./generated\";\nimport { TextAnalyticsAction } from \"./textAnalyticsAction\";\nimport { createSpan } from \"./tracing\";\nimport { LroResponse } from \"@azure/core-lro\";\n\ninterface IdObject {\n id: string;\n}\n\n/**\n * Given a sorted array of input objects (with a unique ID) and an unsorted array of results,\n * return a sorted array of results.\n *\n * @internal\n * @param sortedArray - An array of entries sorted by `id`\n * @param unsortedArray - An array of entries that contain `id` but are not sorted\n */\nexport function sortResponseIdObjects<T extends IdObject, U extends IdObject>(\n sortedArray: T[],\n unsortedArray: U[]\n): U[] {\n const unsortedMap = new Map<string, U>();\n for (const item of unsortedArray) {\n unsortedMap.set(item.id, item);\n }\n\n if (unsortedArray.length !== sortedArray.length) {\n const ordinal = unsortedArray.length > sortedArray.length ? \"more\" : \"fewer\";\n logger.warning(\n `The service returned ${ordinal} responses than inputs. Some errors may be treated as fatal.`\n );\n }\n\n const result: U[] = [];\n for (const sortedItem of sortedArray) {\n const item = unsortedMap.get(sortedItem.id);\n if (item) {\n result.push(item);\n }\n }\n return result;\n}\n\n/**\n * @internal\n */\nexport interface AssessmentIndex {\n document: number;\n sentence: number;\n assessment: number;\n}\n\n/**\n * @internal\n */\nexport function parseAssessmentIndex(pointer: string): AssessmentIndex {\n const regex = new RegExp(/#\\/documents\\/(\\d+)\\/sentences\\/(\\d+)\\/assessments\\/(\\d+)/);\n const res = regex.exec(pointer);\n if (res !== null) {\n const assessmentIndex: AssessmentIndex = {\n document: parseInt(res[1]),\n sentence: parseInt(res[2]),\n assessment: parseInt(res[3]),\n };\n return assessmentIndex;\n } else {\n throw new Error(`Pointer \"${pointer}\" is not a valid Assessment pointer`);\n }\n}\n\n/**\n * Parses the index of the healthcare entity from a JSON pointer.\n * @param pointer - a JSON pointer representing an entity\n * @internal\n */\nexport function parseHealthcareEntityIndex(pointer: string): number {\n const regex = new RegExp(/#\\/results\\/documents\\/(\\d+)\\/entities\\/(\\d+)/);\n const res = regex.exec(pointer);\n if (res !== null) {\n return parseInt(res[2]);\n } else {\n throw new Error(`Pointer \"${pointer}\" is not a valid healthcare entity pointer`);\n }\n}\n\nconst jsEncodingUnit = \"Utf16CodeUnit\";\n\n/**\n * Measurement units that can used to calculate the offset and length properties.\n */\nexport type StringIndexType = \"TextElement_v8\" | \"UnicodeCodePoint\" | \"Utf16CodeUnit\";\n\n/**\n * @internal\n */\nexport function addStrEncodingParam<Options extends { stringIndexType?: StringIndexType }>(\n options: Options\n): Options & { stringIndexType: StringIndexType } {\n return { ...options, stringIndexType: options.stringIndexType || jsEncodingUnit };\n}\n\n/**\n * Set the stringIndexType property with default if it does not exist in x.\n * @param options - operation options bag that has a {@link StringIndexType}\n * @internal\n */\nexport function setStrEncodingParam<X extends { stringIndexType?: GeneratedStringIndexType }>(\n x: X\n): X & { stringIndexType: GeneratedStringIndexType } {\n return { ...x, stringIndexType: x.stringIndexType || jsEncodingUnit };\n}\n\nexport function setStrEncodingParamValue(\n stringIndexType?: GeneratedStringIndexType\n): GeneratedStringIndexType {\n return stringIndexType || jsEncodingUnit;\n}\n\n/**\n * Set the opinion mining property\n * @internal\n */\nexport function setOpinionMining<X extends { includeOpinionMining?: boolean }>(\n x: X\n): X & { opinionMining?: boolean } {\n return { ...x, opinionMining: x.includeOpinionMining };\n}\n\n/**\n * Set the pii categories property\n * @internal\n */\nexport function setCategoriesFilter<X extends { categoriesFilter?: string[] }>(\n x: X\n): X & { piiCategories?: string[] } {\n return { ...x, piiCategories: x.categoriesFilter };\n}\n\nexport function setSentenceCount<X extends { maxSentenceCount?: number }>(\n x: X\n): X & { sentenceCount?: number } {\n return { ...x, sentenceCount: x.maxSentenceCount };\n}\n\nexport function setOrderBy<X extends { orderBy?: string }>(x: X): X & { sortBy?: string } {\n return { ...x, sortBy: x.orderBy };\n}\n\n/**\n * @internal\n */\nexport function addParamsToTask<X extends TextAnalyticsAction>(\n action: X\n): { parameters?: Omit<X, \"actionName\">; taskName?: string } {\n const { actionName, ...params } = action;\n return { parameters: params, taskName: actionName };\n}\n\nfunction appendReadableErrorMessage(currentMessage: string, innerMessage: string): string {\n let message = currentMessage;\n if (message.slice(-1) !== \".\") {\n message = message + \".\";\n }\n return message + \" \" + innerMessage;\n}\n\n/**\n * @internal\n * parses incoming errors from the service and if the inner error code is\n * InvalidDocumentBatch, it exposes that as the statusCode instead.\n * @param error - the incoming error\n */\nexport function compileError(errorResponse: unknown): any {\n const castErrorResponse = errorResponse as {\n response: {\n parsedBody?: ErrorResponse;\n };\n statusCode: number;\n };\n if (!castErrorResponse.response) {\n throw errorResponse;\n }\n const topLevelError = castErrorResponse.response.parsedBody?.error;\n if (!topLevelError) return errorResponse;\n let errorMessage = topLevelError.message || \"\";\n let invalidDocumentBatchCode = false;\n function unwrap(error: TextAnalyticsError | InnerError): TextAnalyticsError {\n if (error?.innererror !== undefined && error.innererror.message !== undefined) {\n if (error.innererror.code === \"InvalidDocumentBatch\") {\n invalidDocumentBatchCode = true;\n }\n errorMessage = appendReadableErrorMessage(errorMessage, error.innererror.message);\n return unwrap(error.innererror);\n }\n return error as TextAnalyticsError;\n }\n unwrap(topLevelError);\n return new RestError(errorMessage, {\n code: invalidDocumentBatchCode ? \"InvalidDocumentBatch\" : topLevelError.code,\n statusCode: castErrorResponse.statusCode,\n });\n}\n\n/**\n * @internal\n */\nexport function compose<T1, T2, T3>(fn1: (x: T1) => T2, fn2: (y: T2) => T3): (x: T1) => T3 {\n return (value: T1) => fn2(fn1(value));\n}\n\n/**\n * @internal\n */\nexport async function getRawResponse<TOptions extends OperationOptions, TResult>(\n f: (options: TOptions) => Promise<TResult>,\n options: TOptions\n): Promise<LroResponse<TResult>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse | undefined = undefined;\n const flatResponse = await f({\n ...options,\n onResponse: (response: FullOperationResponse, flatResponseParam: unknown) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\n/**\n * @internal\n */\nexport async function sendGetRequest<TOptions extends OperationOptions>(\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n client: GeneratedClient,\n spec: OperationSpec,\n spanStr: string,\n options: TOptions,\n path: string\n): Promise<LroResponse<unknown>> {\n const { span, updatedOptions: finalOptions } = createSpan(\n `TextAnalyticsClient-${spanStr}`,\n options\n );\n try {\n const { flatResponse, rawResponse } = await getRawResponse(\n (paramOptions) =>\n client.sendOperationRequest(\n { options: paramOptions },\n {\n ...spec,\n path,\n httpMethod: \"GET\",\n }\n ),\n finalOptions\n );\n return {\n flatResponse: flatResponse,\n rawResponse,\n };\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n}\n"]}
1
+ {"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AAV,UAAU,CAAG,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC5C,CAAC,IACD,CAAC;IACH,OAAO;QACL,YAAY;QACZ,WAAW,EAAE;YACX,UAAU,EAAE,WAAY,CAAC,MAAM;YAC/B,OAAO,EAAE,WAAY,CAAC,OAAO,CAAC,MAAM,EAAE;YACtC,IAAI,EAAE,WAAY,CAAC,UAAU;SAC9B;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;AAClC,wEAAwE;AACxE,MAAuB,EACvB,IAAmB,EACnB,OAAe,EACf,OAAiB,EACjB,IAAY;IAEZ,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,UAAU,CACvD,uBAAuB,OAAO,EAAE,EAChC,OAAO,CACR,CAAC;IACF,IAAI;QACF,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,MAAM,cAAc,CACxD,CAAC,YAAY,EAAE,EAAE,CACf,MAAM,CAAC,oBAAoB,CACzB,EAAE,OAAO,EAAE,YAAY,EAAE,kCAEpB,IAAI,KACP,IAAI,EACJ,UAAU,EAAE,KAAK,IAEpB,EACH,YAAY,CACb,CAAC;QACF,OAAO;YACL,YAAY,EAAE,YAAY;YAC1B,WAAW;SACZ,CAAC;KACH;IAAC,OAAO,CAAM,EAAE;QACf,IAAI,CAAC,SAAS,CAAC;YACb,IAAI,EAAE,cAAc,CAAC,KAAK;YAC1B,OAAO,EAAE,CAAC,CAAC,OAAO;SACnB,CAAC,CAAC;QACH,MAAM,CAAC,CAAC;KACT;YAAS;QACR,IAAI,CAAC,GAAG,EAAE,CAAC;KACZ;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { FullOperationResponse, OperationOptions, OperationSpec } from \"@azure/core-client\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport { logger } from \"./logger\";\nimport {\n ErrorResponse,\n GeneratedClient,\n InnerError,\n StringIndexType as GeneratedStringIndexType,\n TextAnalyticsError,\n} from \"./generated\";\nimport { TextAnalyticsAction } from \"./textAnalyticsAction\";\nimport { createSpan } from \"./tracing\";\nimport { LroResponse } from \"@azure/core-lro\";\n\ninterface IdObject {\n id: string;\n}\n\n/**\n * Given a sorted array of input objects (with a unique ID) and an unsorted array of results,\n * return a sorted array of results.\n *\n * @internal\n * @param sortedArray - An array of entries sorted by `id`\n * @param unsortedArray - An array of entries that contain `id` but are not sorted\n */\nexport function sortResponseIdObjects<T extends IdObject, U extends IdObject>(\n sortedArray: T[],\n unsortedArray: U[]\n): U[] {\n const unsortedMap = new Map<string, U>();\n for (const item of unsortedArray) {\n unsortedMap.set(item.id, item);\n }\n\n if (unsortedArray.length !== sortedArray.length) {\n const ordinal = unsortedArray.length > sortedArray.length ? \"more\" : \"fewer\";\n logger.warning(\n `The service returned ${ordinal} responses than inputs. Some errors may be treated as fatal.`\n );\n }\n\n const result: U[] = [];\n for (const sortedItem of sortedArray) {\n const item = unsortedMap.get(sortedItem.id);\n if (item) {\n result.push(item);\n }\n }\n return result;\n}\n\n/**\n * @internal\n */\nexport interface AssessmentIndex {\n document: number;\n sentence: number;\n assessment: number;\n}\n\n/**\n * @internal\n */\nexport function parseAssessmentIndex(pointer: string): AssessmentIndex {\n const regex = new RegExp(/#\\/documents\\/(\\d+)\\/sentences\\/(\\d+)\\/assessments\\/(\\d+)/);\n const res = regex.exec(pointer);\n if (res !== null) {\n const assessmentIndex: AssessmentIndex = {\n document: parseInt(res[1]),\n sentence: parseInt(res[2]),\n assessment: parseInt(res[3]),\n };\n return assessmentIndex;\n } else {\n throw new Error(`Pointer \"${pointer}\" is not a valid Assessment pointer`);\n }\n}\n\n/**\n * Parses the index of the healthcare entity from a JSON pointer.\n * @param pointer - a JSON pointer representing an entity\n * @internal\n */\nexport function parseHealthcareEntityIndex(pointer: string): number {\n const regex = new RegExp(/#\\/results\\/documents\\/(\\d+)\\/entities\\/(\\d+)/);\n const res = regex.exec(pointer);\n if (res !== null) {\n return parseInt(res[2]);\n } else {\n throw new Error(`Pointer \"${pointer}\" is not a valid healthcare entity pointer`);\n }\n}\n\nconst jsEncodingUnit = \"Utf16CodeUnit\";\n\n/**\n * Measurement units that can used to calculate the offset and length properties.\n */\nexport type StringIndexType = \"TextElement_v8\" | \"UnicodeCodePoint\" | \"Utf16CodeUnit\";\n\n/**\n * @internal\n */\nexport function addStrEncodingParam<Options extends { stringIndexType?: StringIndexType }>(\n options: Options\n): Options & { stringIndexType: StringIndexType } {\n return { ...options, stringIndexType: options.stringIndexType || jsEncodingUnit };\n}\n\n/**\n * Set the stringIndexType property with default if it does not exist in x.\n * @param options - operation options bag that has a {@link StringIndexType}\n * @internal\n */\nexport function setStrEncodingParam<X extends { stringIndexType?: GeneratedStringIndexType }>(\n x: X\n): X & { stringIndexType: GeneratedStringIndexType } {\n return { ...x, stringIndexType: x.stringIndexType || jsEncodingUnit };\n}\n\nexport function setStrEncodingParamValue(\n stringIndexType?: GeneratedStringIndexType\n): GeneratedStringIndexType {\n return stringIndexType || jsEncodingUnit;\n}\n\n/**\n * Set the opinion mining property\n * @internal\n */\nexport function setOpinionMining<X extends { includeOpinionMining?: boolean }>(\n x: X\n): X & { opinionMining?: boolean } {\n return { ...x, opinionMining: x.includeOpinionMining };\n}\n\n/**\n * Set the pii categories property\n * @internal\n */\nexport function setCategoriesFilter<X extends { categoriesFilter?: string[] }>(\n x: X\n): X & { piiCategories?: string[] } {\n return { ...x, piiCategories: x.categoriesFilter };\n}\n\nexport function setSentenceCount<X extends { maxSentenceCount?: number }>(\n x: X\n): X & { sentenceCount?: number } {\n return { ...x, sentenceCount: x.maxSentenceCount };\n}\n\nexport function setOrderBy<X extends { orderBy?: string }>(x: X): X & { sortBy?: string } {\n return { ...x, sortBy: x.orderBy };\n}\n\n/**\n * @internal\n */\nexport function addParamsToTask<X extends TextAnalyticsAction>(\n action: X\n): { parameters?: Omit<X, \"actionName\">; taskName?: string } {\n const { actionName, ...params } = action;\n return { parameters: params, taskName: actionName };\n}\n\nfunction appendReadableErrorMessage(currentMessage: string, innerMessage: string): string {\n let message = currentMessage;\n if (message.slice(-1) !== \".\") {\n message = message + \".\";\n }\n return message + \" \" + innerMessage;\n}\n\n/**\n * @internal\n * parses incoming errors from the service and if the inner error code is\n * InvalidDocumentBatch, it exposes that as the statusCode instead.\n * @param error - the incoming error\n */\nexport function compileError(errorResponse: unknown): any {\n const castErrorResponse = errorResponse as {\n response: {\n parsedBody?: ErrorResponse;\n };\n statusCode: number;\n };\n if (!castErrorResponse.response) {\n throw errorResponse;\n }\n const topLevelError = castErrorResponse.response.parsedBody?.error;\n if (!topLevelError) return errorResponse;\n let errorMessage = topLevelError.message || \"\";\n let invalidDocumentBatchCode = false;\n function unwrap(error: TextAnalyticsError | InnerError): TextAnalyticsError {\n if (error?.innererror !== undefined && error.innererror.message !== undefined) {\n if (error.innererror.code === \"InvalidDocumentBatch\") {\n invalidDocumentBatchCode = true;\n }\n errorMessage = appendReadableErrorMessage(errorMessage, error.innererror.message);\n return unwrap(error.innererror);\n }\n return error as TextAnalyticsError;\n }\n unwrap(topLevelError);\n return new RestError(errorMessage, {\n code: invalidDocumentBatchCode ? \"InvalidDocumentBatch\" : topLevelError.code,\n statusCode: castErrorResponse.statusCode,\n });\n}\n\n/**\n * @internal\n */\nexport function compose<T1, T2, T3>(fn1: (x: T1) => T2, fn2: (y: T2) => T3): (x: T1) => T3 {\n return (value: T1) => fn2(fn1(value));\n}\n\n/**\n * @internal\n */\nexport async function getRawResponse<TOptions extends OperationOptions, TResult>(\n f: (options: TOptions) => Promise<TResult>,\n options: TOptions\n): Promise<LroResponse<TResult>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse | undefined = undefined;\n const flatResponse = await f({\n ...options,\n onResponse: (response: FullOperationResponse, flatResponseParam: unknown) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\n/**\n * @internal\n */\nexport async function sendGetRequest<TOptions extends OperationOptions>(\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n client: GeneratedClient,\n spec: OperationSpec,\n spanStr: string,\n options: TOptions,\n path: string\n): Promise<LroResponse<unknown>> {\n const { span, updatedOptions: finalOptions } = createSpan(\n `TextAnalyticsClient-${spanStr}`,\n options\n );\n try {\n const { flatResponse, rawResponse } = await getRawResponse(\n (paramOptions) =>\n client.sendOperationRequest(\n { options: paramOptions },\n {\n ...spec,\n path,\n httpMethod: \"GET\",\n }\n ),\n finalOptions\n );\n return {\n flatResponse: flatResponse,\n rawResponse,\n };\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n}\n"]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "An isomorphic client library for the Azure Text Analytics service.",
6
- "version": "5.2.0-alpha.20220407.1",
6
+ "version": "5.2.0-alpha.20220421.1",
7
7
  "keywords": [
8
8
  "node",
9
9
  "azure",
@@ -97,9 +97,9 @@
97
97
  "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
98
98
  "@azure/identity": "^2.0.1",
99
99
  "@azure/test-utils": ">=1.0.0-alpha <1.0.0-alphb",
100
- "@azure-tools/test-recorder": ">=2.0.0-alpha <2.0.0-alphb",
100
+ "@azure-tools/test-recorder": "^2.0.0",
101
101
  "@azure-tools/test-credential": ">=1.0.0-alpha <1.0.0-alphb",
102
- "@microsoft/api-extractor": "^7.18.11",
102
+ "@microsoft/api-extractor": "7.18.11",
103
103
  "@types/chai": "^4.1.6",
104
104
  "@types/chai-as-promised": "^7.1.0",
105
105
  "@types/mocha": "^7.0.2",