@azure/ai-text-analytics 5.2.0-alpha.20220107.1 → 5.2.0-alpha.20220303.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +56 -28
- package/dist/index.js.map +1 -1
- package/package.json +14 -19
package/README.md
CHANGED
|
@@ -510,7 +510,7 @@ main();
|
|
|
510
510
|
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
|
|
511
511
|
|
|
512
512
|
```javascript
|
|
513
|
-
|
|
513
|
+
const { logger } = require("@azure/logger");
|
|
514
514
|
|
|
515
515
|
setLogLevel("info");
|
|
516
516
|
```
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,26 @@ var coreTracing = require('@azure/core-tracing');
|
|
|
11
11
|
var corePaging = require('@azure/core-paging');
|
|
12
12
|
var coreLro = require('@azure/core-lro');
|
|
13
13
|
|
|
14
|
+
function _interopNamespace(e) {
|
|
15
|
+
if (e && e.__esModule) return e;
|
|
16
|
+
var n = Object.create(null);
|
|
17
|
+
if (e) {
|
|
18
|
+
Object.keys(e).forEach(function (k) {
|
|
19
|
+
if (k !== 'default') {
|
|
20
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
21
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return e[k]; }
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
n["default"] = e;
|
|
29
|
+
return Object.freeze(n);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
|
|
33
|
+
|
|
14
34
|
/*
|
|
15
35
|
* Copyright (c) Microsoft Corporation.
|
|
16
36
|
* Licensed under the MIT License.
|
|
@@ -3599,7 +3619,7 @@ const opinionMining = {
|
|
|
3599
3619
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
3600
3620
|
*/
|
|
3601
3621
|
/** @internal */
|
|
3602
|
-
class GeneratedClientContext extends
|
|
3622
|
+
class GeneratedClientContext extends coreClient__namespace.ServiceClient {
|
|
3603
3623
|
/**
|
|
3604
3624
|
* Initializes a new instance of the GeneratedClientContext class.
|
|
3605
3625
|
* @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example:
|
|
@@ -3665,7 +3685,7 @@ class GeneratedClient extends GeneratedClientContext {
|
|
|
3665
3685
|
* @param options The options parameters.
|
|
3666
3686
|
*/
|
|
3667
3687
|
analyzeStatus(jobId, options) {
|
|
3668
|
-
return this.sendOperationRequest({ jobId, options }, analyzeStatusOperationSpec);
|
|
3688
|
+
return this.sendOperationRequest({ jobId, options }, analyzeStatusOperationSpec$1);
|
|
3669
3689
|
}
|
|
3670
3690
|
/**
|
|
3671
3691
|
* Get details of the healthcare prediction job specified by the jobId.
|
|
@@ -3673,7 +3693,7 @@ class GeneratedClient extends GeneratedClientContext {
|
|
|
3673
3693
|
* @param options The options parameters.
|
|
3674
3694
|
*/
|
|
3675
3695
|
healthStatus(jobId, options) {
|
|
3676
|
-
return this.sendOperationRequest({ jobId, options }, healthStatusOperationSpec);
|
|
3696
|
+
return this.sendOperationRequest({ jobId, options }, healthStatusOperationSpec$1);
|
|
3677
3697
|
}
|
|
3678
3698
|
/**
|
|
3679
3699
|
* Cancel healthcare prediction job.
|
|
@@ -3758,7 +3778,7 @@ class GeneratedClient extends GeneratedClientContext {
|
|
|
3758
3778
|
}
|
|
3759
3779
|
}
|
|
3760
3780
|
// Operation Specifications
|
|
3761
|
-
const serializer =
|
|
3781
|
+
const serializer$2 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
|
|
3762
3782
|
const analyzeOperationSpec = {
|
|
3763
3783
|
path: "/analyze",
|
|
3764
3784
|
httpMethod: "POST",
|
|
@@ -3774,9 +3794,9 @@ const analyzeOperationSpec = {
|
|
|
3774
3794
|
urlParameters: [endpoint, apiVersion],
|
|
3775
3795
|
headerParameters: [contentType, accept],
|
|
3776
3796
|
mediaType: "json",
|
|
3777
|
-
serializer
|
|
3797
|
+
serializer: serializer$2
|
|
3778
3798
|
};
|
|
3779
|
-
const analyzeStatusOperationSpec = {
|
|
3799
|
+
const analyzeStatusOperationSpec$1 = {
|
|
3780
3800
|
path: "/analyze/jobs/{jobId}",
|
|
3781
3801
|
httpMethod: "GET",
|
|
3782
3802
|
responses: {
|
|
@@ -3794,9 +3814,9 @@ const analyzeStatusOperationSpec = {
|
|
|
3794
3814
|
],
|
|
3795
3815
|
urlParameters: [endpoint, apiVersion, jobId],
|
|
3796
3816
|
headerParameters: [accept],
|
|
3797
|
-
serializer
|
|
3817
|
+
serializer: serializer$2
|
|
3798
3818
|
};
|
|
3799
|
-
const healthStatusOperationSpec = {
|
|
3819
|
+
const healthStatusOperationSpec$1 = {
|
|
3800
3820
|
path: "/entities/health/jobs/{jobId}",
|
|
3801
3821
|
httpMethod: "GET",
|
|
3802
3822
|
responses: {
|
|
@@ -3818,7 +3838,7 @@ const healthStatusOperationSpec = {
|
|
|
3818
3838
|
jobId1
|
|
3819
3839
|
],
|
|
3820
3840
|
headerParameters: [accept],
|
|
3821
|
-
serializer
|
|
3841
|
+
serializer: serializer$2
|
|
3822
3842
|
};
|
|
3823
3843
|
const cancelHealthJobOperationSpec = {
|
|
3824
3844
|
path: "/entities/health/jobs/{jobId}",
|
|
@@ -3837,7 +3857,7 @@ const cancelHealthJobOperationSpec = {
|
|
|
3837
3857
|
jobId1
|
|
3838
3858
|
],
|
|
3839
3859
|
headerParameters: [accept],
|
|
3840
|
-
serializer
|
|
3860
|
+
serializer: serializer$2
|
|
3841
3861
|
};
|
|
3842
3862
|
const healthOperationSpec = {
|
|
3843
3863
|
path: "/entities/health/jobs",
|
|
@@ -3859,7 +3879,7 @@ const healthOperationSpec = {
|
|
|
3859
3879
|
urlParameters: [endpoint, apiVersion],
|
|
3860
3880
|
headerParameters: [contentType, accept],
|
|
3861
3881
|
mediaType: "json",
|
|
3862
|
-
serializer
|
|
3882
|
+
serializer: serializer$2
|
|
3863
3883
|
};
|
|
3864
3884
|
const entitiesRecognitionGeneralOperationSpec = {
|
|
3865
3885
|
path: "/entities/recognition/general",
|
|
@@ -3882,7 +3902,7 @@ const entitiesRecognitionGeneralOperationSpec = {
|
|
|
3882
3902
|
urlParameters: [endpoint, apiVersion],
|
|
3883
3903
|
headerParameters: [contentType, accept],
|
|
3884
3904
|
mediaType: "json",
|
|
3885
|
-
serializer
|
|
3905
|
+
serializer: serializer$2
|
|
3886
3906
|
};
|
|
3887
3907
|
const entitiesRecognitionPiiOperationSpec = {
|
|
3888
3908
|
path: "/entities/recognition/pii",
|
|
@@ -3907,7 +3927,7 @@ const entitiesRecognitionPiiOperationSpec = {
|
|
|
3907
3927
|
urlParameters: [endpoint, apiVersion],
|
|
3908
3928
|
headerParameters: [contentType, accept],
|
|
3909
3929
|
mediaType: "json",
|
|
3910
|
-
serializer
|
|
3930
|
+
serializer: serializer$2
|
|
3911
3931
|
};
|
|
3912
3932
|
const entitiesLinkingOperationSpec = {
|
|
3913
3933
|
path: "/entities/linking",
|
|
@@ -3930,7 +3950,7 @@ const entitiesLinkingOperationSpec = {
|
|
|
3930
3950
|
urlParameters: [endpoint, apiVersion],
|
|
3931
3951
|
headerParameters: [contentType, accept],
|
|
3932
3952
|
mediaType: "json",
|
|
3933
|
-
serializer
|
|
3953
|
+
serializer: serializer$2
|
|
3934
3954
|
};
|
|
3935
3955
|
const keyPhrasesOperationSpec = {
|
|
3936
3956
|
path: "/keyPhrases",
|
|
@@ -3952,7 +3972,7 @@ const keyPhrasesOperationSpec = {
|
|
|
3952
3972
|
urlParameters: [endpoint, apiVersion],
|
|
3953
3973
|
headerParameters: [contentType, accept],
|
|
3954
3974
|
mediaType: "json",
|
|
3955
|
-
serializer
|
|
3975
|
+
serializer: serializer$2
|
|
3956
3976
|
};
|
|
3957
3977
|
const languagesOperationSpec = {
|
|
3958
3978
|
path: "/languages",
|
|
@@ -3974,7 +3994,7 @@ const languagesOperationSpec = {
|
|
|
3974
3994
|
urlParameters: [endpoint, apiVersion],
|
|
3975
3995
|
headerParameters: [contentType, accept],
|
|
3976
3996
|
mediaType: "json",
|
|
3977
|
-
serializer
|
|
3997
|
+
serializer: serializer$2
|
|
3978
3998
|
};
|
|
3979
3999
|
const sentimentOperationSpec = {
|
|
3980
4000
|
path: "/sentiment",
|
|
@@ -3998,7 +4018,7 @@ const sentimentOperationSpec = {
|
|
|
3998
4018
|
urlParameters: [endpoint, apiVersion],
|
|
3999
4019
|
headerParameters: [contentType, accept],
|
|
4000
4020
|
mediaType: "json",
|
|
4001
|
-
serializer
|
|
4021
|
+
serializer: serializer$2
|
|
4002
4022
|
};
|
|
4003
4023
|
|
|
4004
4024
|
// Copyright (c) Microsoft Corporation.
|
|
@@ -4566,7 +4586,7 @@ function makeHealthcareEntitiesErrorResult(id, error) {
|
|
|
4566
4586
|
// Copyright (c) Microsoft Corporation.
|
|
4567
4587
|
const serializer$1 = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
4568
4588
|
// Consider whether the spec can be exported by code gen
|
|
4569
|
-
const healthStatusOperationSpec
|
|
4589
|
+
const healthStatusOperationSpec = {
|
|
4570
4590
|
path: "/entities/health/jobs/{jobId}",
|
|
4571
4591
|
httpMethod: "GET",
|
|
4572
4592
|
responses: {
|
|
@@ -4619,7 +4639,7 @@ class HealthLro {
|
|
|
4619
4639
|
}
|
|
4620
4640
|
}
|
|
4621
4641
|
async sendPollRequest(path) {
|
|
4622
|
-
return sendGetRequest(this.client, healthStatusOperationSpec
|
|
4642
|
+
return sendGetRequest(this.client, healthStatusOperationSpec, "HealthStatus", Object.assign(Object.assign({}, this.baseOptions), this.pollOptions), path);
|
|
4623
4643
|
}
|
|
4624
4644
|
}
|
|
4625
4645
|
/**
|
|
@@ -4658,7 +4678,7 @@ client, documents, options) {
|
|
|
4658
4678
|
const pagedResult = {
|
|
4659
4679
|
firstPageLink: pollingURL,
|
|
4660
4680
|
getPage: async (pageLink, maxPageSize) => {
|
|
4661
|
-
const response = await sendGetRequest(client, healthStatusOperationSpec
|
|
4681
|
+
const response = await sendGetRequest(client, healthStatusOperationSpec, "HealthStatus",
|
|
4662
4682
|
// if `top` is set to `undefined`, the default value will not be sent
|
|
4663
4683
|
// as part of the request.
|
|
4664
4684
|
maxPageSize ? Object.assign(Object.assign({}, options), { top: maxPageSize }) : options, pageLink);
|
|
@@ -4979,9 +4999,9 @@ function createAnalyzeActionsResult(response, documents) {
|
|
|
4979
4999
|
}
|
|
4980
5000
|
|
|
4981
5001
|
// Copyright (c) Microsoft Corporation.
|
|
4982
|
-
const serializer
|
|
5002
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
4983
5003
|
// Consider whether the spec can be exported by code gen
|
|
4984
|
-
const analyzeStatusOperationSpec
|
|
5004
|
+
const analyzeStatusOperationSpec = {
|
|
4985
5005
|
httpMethod: "GET",
|
|
4986
5006
|
responses: {
|
|
4987
5007
|
200: {
|
|
@@ -4994,7 +5014,7 @@ const analyzeStatusOperationSpec$1 = {
|
|
|
4994
5014
|
queryParameters: [includeStatistics, top, skip],
|
|
4995
5015
|
urlParameters: [endpoint, apiVersion],
|
|
4996
5016
|
headerParameters: [accept],
|
|
4997
|
-
serializer
|
|
5017
|
+
serializer,
|
|
4998
5018
|
};
|
|
4999
5019
|
/**
|
|
5000
5020
|
* @internal
|
|
@@ -5038,7 +5058,7 @@ class AnalyzeLro {
|
|
|
5038
5058
|
}
|
|
5039
5059
|
}
|
|
5040
5060
|
async sendPollRequest(path) {
|
|
5041
|
-
return sendGetRequest(this.client, analyzeStatusOperationSpec
|
|
5061
|
+
return sendGetRequest(this.client, analyzeStatusOperationSpec, "AnalyzeStatus", Object.assign(Object.assign({}, this.baseOptions), this.pollOptions), path);
|
|
5042
5062
|
}
|
|
5043
5063
|
}
|
|
5044
5064
|
/**
|
|
@@ -5066,7 +5086,7 @@ client, documents, options) {
|
|
|
5066
5086
|
const pagedResult = {
|
|
5067
5087
|
firstPageLink: pollingURL,
|
|
5068
5088
|
getPage: async (pageLink, maxPageSize) => {
|
|
5069
|
-
const response = await sendGetRequest(client, analyzeStatusOperationSpec
|
|
5089
|
+
const response = await sendGetRequest(client, analyzeStatusOperationSpec, "AnalyzeStatus",
|
|
5070
5090
|
// if `top` is set to `undefined`, the default value will not be sent
|
|
5071
5091
|
// as part of the request.
|
|
5072
5092
|
maxPageSize ? Object.assign(Object.assign({}, options), { top: maxPageSize }) : options, pageLink);
|
|
@@ -5103,6 +5123,10 @@ function updateAnalyzeState(state, lastResponse) {
|
|
|
5103
5123
|
|
|
5104
5124
|
// Copyright (c) Microsoft Corporation.
|
|
5105
5125
|
const DEFAULT_COGNITIVE_SCOPE = "https://cognitiveservices.azure.com/.default";
|
|
5126
|
+
/**
|
|
5127
|
+
* The types of PII domains the user can choose from.
|
|
5128
|
+
*/
|
|
5129
|
+
exports.PiiEntityDomain = void 0;
|
|
5106
5130
|
(function (PiiEntityDomain) {
|
|
5107
5131
|
/**
|
|
5108
5132
|
* @see {@link https://aka.ms/tanerpii} for more information.
|
|
@@ -5804,6 +5828,8 @@ var KnownErrorCodeValue;
|
|
|
5804
5828
|
KnownErrorCodeValue["ServiceUnavailable"] = "ServiceUnavailable";
|
|
5805
5829
|
KnownErrorCodeValue["NotFound"] = "NotFound";
|
|
5806
5830
|
})(KnownErrorCodeValue || (KnownErrorCodeValue = {}));
|
|
5831
|
+
/** Known values of {@link InnerErrorCodeValue} that the service accepts. */
|
|
5832
|
+
exports.KnownInnerErrorCodeValue = void 0;
|
|
5807
5833
|
(function (KnownInnerErrorCodeValue) {
|
|
5808
5834
|
KnownInnerErrorCodeValue["InvalidParameterValue"] = "InvalidParameterValue";
|
|
5809
5835
|
KnownInnerErrorCodeValue["InvalidRequestBodyFormat"] = "InvalidRequestBodyFormat";
|
|
@@ -5815,10 +5841,14 @@ var KnownErrorCodeValue;
|
|
|
5815
5841
|
KnownInnerErrorCodeValue["UnsupportedLanguageCode"] = "UnsupportedLanguageCode";
|
|
5816
5842
|
KnownInnerErrorCodeValue["InvalidCountryHint"] = "InvalidCountryHint";
|
|
5817
5843
|
})(exports.KnownInnerErrorCodeValue || (exports.KnownInnerErrorCodeValue = {}));
|
|
5844
|
+
/** Known values of {@link WarningCode} that the service accepts. */
|
|
5845
|
+
exports.KnownWarningCode = void 0;
|
|
5818
5846
|
(function (KnownWarningCode) {
|
|
5819
5847
|
KnownWarningCode["LongWordsInDocument"] = "LongWordsInDocument";
|
|
5820
5848
|
KnownWarningCode["DocumentTruncated"] = "DocumentTruncated";
|
|
5821
5849
|
})(exports.KnownWarningCode || (exports.KnownWarningCode = {}));
|
|
5850
|
+
/** Known values of {@link HealthcareEntityCategory} that the service accepts. */
|
|
5851
|
+
exports.KnownHealthcareEntityCategory = void 0;
|
|
5822
5852
|
(function (KnownHealthcareEntityCategory) {
|
|
5823
5853
|
KnownHealthcareEntityCategory["BodyStructure"] = "BODY_STRUCTURE";
|
|
5824
5854
|
KnownHealthcareEntityCategory["AGE"] = "AGE";
|
|
@@ -5875,9 +5905,7 @@ var KnownRelationType;
|
|
|
5875
5905
|
|
|
5876
5906
|
Object.defineProperty(exports, 'AzureKeyCredential', {
|
|
5877
5907
|
enumerable: true,
|
|
5878
|
-
get: function () {
|
|
5879
|
-
return coreAuth.AzureKeyCredential;
|
|
5880
|
-
}
|
|
5908
|
+
get: function () { return coreAuth.AzureKeyCredential; }
|
|
5881
5909
|
});
|
|
5882
5910
|
exports.TextAnalyticsClient = TextAnalyticsClient;
|
|
5883
5911
|
//# sourceMappingURL=index.js.map
|