@azure/ai-text-analytics 5.2.0-beta.2 → 6.0.0-alpha.20220518.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +375 -133
  3. package/dist/index.js +2797 -4176
  4. package/dist/index.js.map +1 -1
  5. package/dist-esm/src/azureKeyCredentialPolicy.js +2 -2
  6. package/dist-esm/src/azureKeyCredentialPolicy.js.map +1 -1
  7. package/dist-esm/src/constants.js +16 -0
  8. package/dist-esm/src/constants.js.map +1 -0
  9. package/dist-esm/src/generated/generatedClient.js +80 -334
  10. package/dist-esm/src/generated/generatedClient.js.map +1 -1
  11. package/dist-esm/src/generated/index.js +1 -1
  12. package/dist-esm/src/generated/index.js.map +1 -1
  13. package/dist-esm/src/generated/models/index.js +106 -35
  14. package/dist-esm/src/generated/models/index.js.map +1 -1
  15. package/dist-esm/src/generated/models/mappers.js +1625 -2101
  16. package/dist-esm/src/generated/models/mappers.js.map +1 -1
  17. package/dist-esm/src/generated/models/parameters.js +18 -105
  18. package/dist-esm/src/generated/models/parameters.js.map +1 -1
  19. package/dist-esm/src/generated/operations/analyzeText.js +105 -0
  20. package/dist-esm/src/generated/operations/analyzeText.js.map +1 -0
  21. package/dist-esm/src/generated/operations/index.js +9 -0
  22. package/dist-esm/src/generated/operations/index.js.map +1 -0
  23. package/dist-esm/src/generated/operationsInterfaces/analyzeText.js +9 -0
  24. package/dist-esm/src/generated/operationsInterfaces/analyzeText.js.map +1 -0
  25. package/dist-esm/src/generated/operationsInterfaces/index.js +9 -0
  26. package/dist-esm/src/generated/operationsInterfaces/index.js.map +1 -0
  27. package/dist-esm/src/index.js +14 -5
  28. package/dist-esm/src/index.js.map +1 -1
  29. package/dist-esm/src/lro.js +195 -0
  30. package/dist-esm/src/lro.js.map +1 -0
  31. package/dist-esm/src/models.js +42 -0
  32. package/dist-esm/src/models.js.map +1 -0
  33. package/dist-esm/src/textAnalysisClient.js +197 -0
  34. package/dist-esm/src/textAnalysisClient.js.map +1 -0
  35. package/dist-esm/src/transforms.js +279 -0
  36. package/dist-esm/src/transforms.js.map +1 -0
  37. package/dist-esm/src/util.js +35 -141
  38. package/dist-esm/src/util.js.map +1 -1
  39. package/package.json +25 -33
  40. package/types/ai-text-analytics.d.ts +1402 -1421
  41. package/CHANGELOG.md +0 -162
  42. package/dist-esm/src/analyzeActionsResult.js +0 -205
  43. package/dist-esm/src/analyzeActionsResult.js.map +0 -1
  44. package/dist-esm/src/analyzeHealthcareEntitiesResult.js +0 -53
  45. package/dist-esm/src/analyzeHealthcareEntitiesResult.js.map +0 -1
  46. package/dist-esm/src/analyzeLro.js +0 -132
  47. package/dist-esm/src/analyzeLro.js.map +0 -1
  48. package/dist-esm/src/analyzeSentimentResult.js +0 -74
  49. package/dist-esm/src/analyzeSentimentResult.js.map +0 -1
  50. package/dist-esm/src/analyzeSentimentResultArray.js +0 -11
  51. package/dist-esm/src/analyzeSentimentResultArray.js.map +0 -1
  52. package/dist-esm/src/detectLanguageResult.js +0 -17
  53. package/dist-esm/src/detectLanguageResult.js.map +0 -1
  54. package/dist-esm/src/detectLanguageResultArray.js +0 -11
  55. package/dist-esm/src/detectLanguageResultArray.js.map +0 -1
  56. package/dist-esm/src/extractKeyPhrasesResult.js +0 -17
  57. package/dist-esm/src/extractKeyPhrasesResult.js.map +0 -1
  58. package/dist-esm/src/extractKeyPhrasesResultArray.js +0 -11
  59. package/dist-esm/src/extractKeyPhrasesResultArray.js.map +0 -1
  60. package/dist-esm/src/extractSummaryResult.js +0 -17
  61. package/dist-esm/src/extractSummaryResult.js.map +0 -1
  62. package/dist-esm/src/extractSummaryResultArray.js +0 -11
  63. package/dist-esm/src/extractSummaryResultArray.js.map +0 -1
  64. package/dist-esm/src/generated/generatedClientContext.js +0 -42
  65. package/dist-esm/src/generated/generatedClientContext.js.map +0 -1
  66. package/dist-esm/src/healthLro.js +0 -139
  67. package/dist-esm/src/healthLro.js.map +0 -1
  68. package/dist-esm/src/multiCategoryClassifyResult.js +0 -17
  69. package/dist-esm/src/multiCategoryClassifyResult.js.map +0 -1
  70. package/dist-esm/src/multiCategoryClassifyResultArray.js +0 -11
  71. package/dist-esm/src/multiCategoryClassifyResultArray.js.map +0 -1
  72. package/dist-esm/src/pollerModels.js +0 -4
  73. package/dist-esm/src/pollerModels.js.map +0 -1
  74. package/dist-esm/src/recognizeCategorizedEntitiesResult.js +0 -17
  75. package/dist-esm/src/recognizeCategorizedEntitiesResult.js.map +0 -1
  76. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js +0 -11
  77. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js.map +0 -1
  78. package/dist-esm/src/recognizeCustomEntitiesResult.js +0 -17
  79. package/dist-esm/src/recognizeCustomEntitiesResult.js.map +0 -1
  80. package/dist-esm/src/recognizeCustomEntitiesResultArray.js +0 -11
  81. package/dist-esm/src/recognizeCustomEntitiesResultArray.js.map +0 -1
  82. package/dist-esm/src/recognizeLinkedEntitiesResult.js +0 -17
  83. package/dist-esm/src/recognizeLinkedEntitiesResult.js.map +0 -1
  84. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js +0 -11
  85. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js.map +0 -1
  86. package/dist-esm/src/recognizePiiEntitiesResult.js +0 -18
  87. package/dist-esm/src/recognizePiiEntitiesResult.js.map +0 -1
  88. package/dist-esm/src/recognizePiiEntitiesResultArray.js +0 -11
  89. package/dist-esm/src/recognizePiiEntitiesResultArray.js.map +0 -1
  90. package/dist-esm/src/singleCategoryClassifyResult.js +0 -17
  91. package/dist-esm/src/singleCategoryClassifyResult.js.map +0 -1
  92. package/dist-esm/src/singleCategoryClassifyResultArray.js +0 -11
  93. package/dist-esm/src/singleCategoryClassifyResultArray.js.map +0 -1
  94. package/dist-esm/src/textAnalyticsAction.js +0 -4
  95. package/dist-esm/src/textAnalyticsAction.js.map +0 -1
  96. package/dist-esm/src/textAnalyticsClient.js +0 -511
  97. package/dist-esm/src/textAnalyticsClient.js.map +0 -1
  98. package/dist-esm/src/textAnalyticsOperationOptions.js +0 -4
  99. package/dist-esm/src/textAnalyticsOperationOptions.js.map +0 -1
  100. package/dist-esm/src/textAnalyticsResult.js +0 -94
  101. package/dist-esm/src/textAnalyticsResult.js.map +0 -1
  102. package/dist-esm/src/tracing.js +0 -12
  103. package/dist-esm/src/tracing.js.map +0 -1
@@ -4,7 +4,7 @@ const API_KEY_HEADER_NAME = "Ocp-Apim-Subscription-Key";
4
4
  /**
5
5
  * The programmatic identifier of the textAnalyticsAzureKeyCredentialPolicy.
6
6
  */
7
- export const textAnalyticsAzureKeyCredentialPolicyName = "textAnalyticsAzureKeyCredentialPolicy";
7
+ const textAnalyticsAzureKeyCredentialPolicyName = "textAnalyticsAzureKeyCredentialPolicy";
8
8
  /**
9
9
  * Create an HTTP pipeline policy to authenticate a request
10
10
  * using an `AzureKeyCredential` for Text Analytics
@@ -16,7 +16,7 @@ export function textAnalyticsAzureKeyCredentialPolicy(credential) {
16
16
  sendRequest(request, next) {
17
17
  request.headers.set(API_KEY_HEADER_NAME, credential.key);
18
18
  return next(request);
19
- }
19
+ },
20
20
  };
21
21
  }
22
22
  //# sourceMappingURL=azureKeyCredentialPolicy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"azureKeyCredentialPolicy.js","sourceRoot":"","sources":["../../src/azureKeyCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AAExD;;GAEG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,uCAAuC,CAAC;AAEjG;;;;GAIG;AACH,MAAM,UAAU,qCAAqC,CAAC,UAAyB;IAC7E,OAAO;QACL,IAAI,EAAE,yCAAyC;QAC/C,WAAW,CAAC,OAAwB,EAAE,IAAiB;YACrD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YACzD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { KeyCredential } from \"@azure/core-auth\";\nimport {\n PipelineResponse,\n PipelineRequest,\n SendRequest,\n PipelinePolicy\n} from \"@azure/core-rest-pipeline\";\n\nconst API_KEY_HEADER_NAME = \"Ocp-Apim-Subscription-Key\";\n\n/**\n * The programmatic identifier of the textAnalyticsAzureKeyCredentialPolicy.\n */\nexport const textAnalyticsAzureKeyCredentialPolicyName = \"textAnalyticsAzureKeyCredentialPolicy\";\n\n/**\n * Create an HTTP pipeline policy to authenticate a request\n * using an `AzureKeyCredential` for Text Analytics\n * @internal\n */\nexport function textAnalyticsAzureKeyCredentialPolicy(credential: KeyCredential): PipelinePolicy {\n return {\n name: textAnalyticsAzureKeyCredentialPolicyName,\n sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n request.headers.set(API_KEY_HEADER_NAME, credential.key);\n return next(request);\n }\n };\n}\n"]}
1
+ {"version":3,"file":"azureKeyCredentialPolicy.js","sourceRoot":"","sources":["../../src/azureKeyCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AAExD;;GAEG;AACH,MAAM,yCAAyC,GAAG,uCAAuC,CAAC;AAE1F;;;;GAIG;AACH,MAAM,UAAU,qCAAqC,CAAC,UAAyB;IAC7E,OAAO;QACL,IAAI,EAAE,yCAAyC;QAC/C,WAAW,CAAC,OAAwB,EAAE,IAAiB;YACrD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YACzD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { KeyCredential } from \"@azure/core-auth\";\n\nconst API_KEY_HEADER_NAME = \"Ocp-Apim-Subscription-Key\";\n\n/**\n * The programmatic identifier of the textAnalyticsAzureKeyCredentialPolicy.\n */\nconst textAnalyticsAzureKeyCredentialPolicyName = \"textAnalyticsAzureKeyCredentialPolicy\";\n\n/**\n * Create an HTTP pipeline policy to authenticate a request\n * using an `AzureKeyCredential` for Text Analytics\n * @internal\n */\nexport function textAnalyticsAzureKeyCredentialPolicy(credential: KeyCredential): PipelinePolicy {\n return {\n name: textAnalyticsAzureKeyCredentialPolicyName,\n sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n request.headers.set(API_KEY_HEADER_NAME, credential.key);\n return next(request);\n },\n };\n}\n"]}
@@ -0,0 +1,16 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ /**
4
+ * The default AAD permissions scope for Cognitive Services.
5
+ * @internal
6
+ */
7
+ export const DEFAULT_COGNITIVE_SCOPE = "https://cognitiveservices.azure.com/.default";
8
+ /**
9
+ * @internal
10
+ */
11
+ export const SDK_VERSION = "6.0.0-beta.1";
12
+ /**
13
+ * @internal
14
+ */
15
+ export const clientName = "TextAnalysisClient";
16
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,8CAA8C,CAAC;AAEtF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * The default AAD permissions scope for Cognitive Services.\n * @internal\n */\nexport const DEFAULT_COGNITIVE_SCOPE = \"https://cognitiveservices.azure.com/.default\";\n\n/**\n * @internal\n */\nexport const SDK_VERSION = \"6.0.0-beta.1\";\n\n/**\n * @internal\n */\nexport const clientName = \"TextAnalysisClient\";\n"]}
@@ -6,366 +6,112 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
  import * as coreClient from "@azure/core-client";
9
+ import * as coreRestPipeline from "@azure/core-rest-pipeline";
10
+ import { AnalyzeTextImpl } from "./operations";
9
11
  import * as Parameters from "./models/parameters";
10
12
  import * as Mappers from "./models/mappers";
11
- import { GeneratedClientContext } from "./generatedClientContext";
12
13
  /** @internal */
13
- export class GeneratedClient extends GeneratedClientContext {
14
+ export class GeneratedClient extends coreClient.ServiceClient {
14
15
  /**
15
16
  * Initializes a new instance of the GeneratedClient class.
16
- * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example:
17
- * https://westus.api.cognitive.microsoft.com).
17
+ * @param endpoint Supported Cognitive Services endpoint (e.g.,
18
+ * https://<resource-name>.api.cognitiveservices.azure.com).
18
19
  * @param options The parameter options
19
20
  */
20
21
  constructor(endpoint, options) {
21
- super(endpoint, options);
22
- }
23
- /**
24
- * Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed.
25
- * @param options The options parameters.
26
- */
27
- analyze(options) {
28
- return this.sendOperationRequest({ options }, analyzeOperationSpec);
29
- }
30
- /**
31
- * Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are
32
- * completed, the job will transition to the completed state and results will be available for each
33
- * task.
34
- * @param jobId Job ID for Analyze
35
- * @param options The options parameters.
36
- */
37
- analyzeStatus(jobId, options) {
38
- return this.sendOperationRequest({ jobId, options }, analyzeStatusOperationSpec);
39
- }
40
- /**
41
- * Get details of the healthcare prediction job specified by the jobId.
42
- * @param jobId Job ID
43
- * @param options The options parameters.
44
- */
45
- healthStatus(jobId, options) {
46
- return this.sendOperationRequest({ jobId, options }, healthStatusOperationSpec);
47
- }
48
- /**
49
- * Cancel healthcare prediction job.
50
- * @param jobId Job ID
51
- * @param options The options parameters.
52
- */
53
- cancelHealthJob(jobId, options) {
54
- return this.sendOperationRequest({ jobId, options }, cancelHealthJobOperationSpec);
55
- }
56
- /**
57
- * Start a healthcare analysis job to recognize healthcare related entities (drugs, conditions,
58
- * symptoms, etc) and their relations.
59
- * @param input Collection of documents to analyze.
60
- * @param options The options parameters.
61
- */
62
- health(input, options) {
63
- return this.sendOperationRequest({ input, options }, healthOperationSpec);
64
- }
65
- /**
66
- * The API returns a list of general named entities in a given document. For the list of supported
67
- * entity types, check <a href="https://aka.ms/taner">Supported Entity Types in Text Analytics API</a>.
68
- * See the <a href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list
69
- * of enabled languages.
70
- * @param input Collection of documents to analyze.
71
- * @param options The options parameters.
72
- */
73
- entitiesRecognitionGeneral(input, options) {
74
- return this.sendOperationRequest({ input, options }, entitiesRecognitionGeneralOperationSpec);
75
- }
76
- /**
77
- * The API returns a list of entities with personal information (\"SSN\", \"Bank Account\" etc) in the
78
- * document. For the list of supported entity types, check <a href="https://aka.ms/tanerpii">Supported
79
- * Entity Types in Text Analytics API</a>. See the <a href="https://aka.ms/talangs">Supported languages
80
- * in Text Analytics API</a> for the list of enabled languages.
81
- *
82
- * @param input Collection of documents to analyze.
83
- * @param options The options parameters.
84
- */
85
- entitiesRecognitionPii(input, options) {
86
- return this.sendOperationRequest({ input, options }, entitiesRecognitionPiiOperationSpec);
87
- }
88
- /**
89
- * The API returns a list of recognized entities with links to a well known knowledge base. See the <a
90
- * href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled
91
- * languages.
92
- * @param input Collection of documents to analyze.
93
- * @param options The options parameters.
94
- */
95
- entitiesLinking(input, options) {
96
- return this.sendOperationRequest({ input, options }, entitiesLinkingOperationSpec);
97
- }
98
- /**
99
- * The API returns a list of strings denoting the key phrases in the input text. See the <a
100
- * href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled
101
- * languages.
102
- * @param input Collection of documents to analyze.
103
- * @param options The options parameters.
104
- */
105
- keyPhrases(input, options) {
106
- return this.sendOperationRequest({ input, options }, keyPhrasesOperationSpec);
22
+ var _a, _b;
23
+ if (endpoint === undefined) {
24
+ throw new Error("'endpoint' cannot be null");
25
+ }
26
+ // Initializing default values for options
27
+ if (!options) {
28
+ options = {};
29
+ }
30
+ const defaults = {
31
+ requestContentType: "application/json; charset=utf-8"
32
+ };
33
+ const packageDetails = `azsdk-js-ai-text-analytics/6.0.0-beta.1`;
34
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
35
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
36
+ : `${packageDetails}`;
37
+ const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
38
+ userAgentPrefix
39
+ }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{Endpoint}/language" });
40
+ super(optionsWithDefaults);
41
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
42
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
43
+ const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
44
+ coreRestPipeline.bearerTokenAuthenticationPolicyName);
45
+ if (!bearerTokenAuthenticationPolicyFound) {
46
+ this.pipeline.removePolicy({
47
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName
48
+ });
49
+ this.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
50
+ scopes: `${optionsWithDefaults.baseUri}/.default`,
51
+ challengeCallbacks: {
52
+ authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge
53
+ }
54
+ }));
55
+ }
56
+ }
57
+ // Parameter assignments
58
+ this.endpoint = endpoint;
59
+ // Assigning values to Constant parameters
60
+ this.apiVersion = options.apiVersion || "2022-04-01-preview";
61
+ this.analyzeText = new AnalyzeTextImpl(this);
62
+ this.addCustomApiVersionPolicy(options.apiVersion);
107
63
  }
108
- /**
109
- * The API returns the detected language and a numeric score between 0 and 1. Scores close to 1
110
- * indicate 100% certainty that the identified language is true. See the <a
111
- * href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled
112
- * languages.
113
- * @param input Collection of documents to analyze for language endpoint.
114
- * @param options The options parameters.
115
- */
116
- languages(input, options) {
117
- return this.sendOperationRequest({ input, options }, languagesOperationSpec);
64
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
65
+ addCustomApiVersionPolicy(apiVersion) {
66
+ if (!apiVersion) {
67
+ return;
68
+ }
69
+ const apiVersionPolicy = {
70
+ name: "CustomApiVersionPolicy",
71
+ async sendRequest(request, next) {
72
+ const param = request.url.split("?");
73
+ if (param.length > 1) {
74
+ const newParams = param[1].split("&").map((item) => {
75
+ if (item.indexOf("api-version") > -1) {
76
+ return item.replace(/(?<==).*$/, apiVersion);
77
+ }
78
+ else {
79
+ return item;
80
+ }
81
+ });
82
+ request.url = param[0] + "?" + newParams.join("&");
83
+ }
84
+ return next(request);
85
+ }
86
+ };
87
+ this.pipeline.addPolicy(apiVersionPolicy);
118
88
  }
119
89
  /**
120
- * The API returns a detailed sentiment analysis for the input text. The analysis is done in multiple
121
- * levels of granularity, start from the a document level, down to sentence and key terms (targets and
122
- * assessments).
123
- * @param input Collection of documents to analyze.
90
+ * Submit a collection of text documents for analysis. Specify a single unique task to be executed
91
+ * immediately.
92
+ * @param body Collection of documents to analyze and a single task to execute.
124
93
  * @param options The options parameters.
125
94
  */
126
- sentiment(input, options) {
127
- return this.sendOperationRequest({ input, options }, sentimentOperationSpec);
95
+ analyze(body, options) {
96
+ return this.sendOperationRequest({ body, options }, analyzeOperationSpec);
128
97
  }
129
98
  }
130
99
  // Operation Specifications
131
100
  const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
132
101
  const analyzeOperationSpec = {
133
- path: "/analyze",
102
+ path: "/:analyze-text",
134
103
  httpMethod: "POST",
135
- responses: {
136
- 202: {
137
- headersMapper: Mappers.GeneratedClientAnalyzeHeaders
138
- },
139
- default: {
140
- bodyMapper: Mappers.ErrorResponse
141
- }
142
- },
143
- requestBody: Parameters.body,
144
- urlParameters: [Parameters.endpoint, Parameters.apiVersion],
145
- headerParameters: [Parameters.contentType, Parameters.accept],
146
- mediaType: "json",
147
- serializer
148
- };
149
- const analyzeStatusOperationSpec = {
150
- path: "/analyze/jobs/{jobId}",
151
- httpMethod: "GET",
152
- responses: {
153
- 200: {
154
- bodyMapper: Mappers.AnalyzeJobState
155
- },
156
- default: {
157
- bodyMapper: Mappers.ErrorResponse
158
- }
159
- },
160
- queryParameters: [
161
- Parameters.includeStatistics,
162
- Parameters.top,
163
- Parameters.skip
164
- ],
165
- urlParameters: [Parameters.endpoint, Parameters.apiVersion, Parameters.jobId],
166
- headerParameters: [Parameters.accept],
167
- serializer
168
- };
169
- const healthStatusOperationSpec = {
170
- path: "/entities/health/jobs/{jobId}",
171
- httpMethod: "GET",
172
104
  responses: {
173
105
  200: {
174
- bodyMapper: Mappers.HealthcareJobState
106
+ bodyMapper: Mappers.AnalyzeTextTaskResult
175
107
  },
176
108
  default: {
177
109
  bodyMapper: Mappers.ErrorResponse
178
110
  }
179
111
  },
180
- queryParameters: [
181
- Parameters.includeStatistics,
182
- Parameters.top,
183
- Parameters.skip
184
- ],
185
- urlParameters: [
186
- Parameters.endpoint,
187
- Parameters.apiVersion,
188
- Parameters.jobId1
189
- ],
190
- headerParameters: [Parameters.accept],
191
- serializer
192
- };
193
- const cancelHealthJobOperationSpec = {
194
- path: "/entities/health/jobs/{jobId}",
195
- httpMethod: "DELETE",
196
- responses: {
197
- 202: {
198
- headersMapper: Mappers.GeneratedClientCancelHealthJobHeaders
199
- },
200
- default: {
201
- bodyMapper: Mappers.ErrorResponse
202
- }
203
- },
204
- urlParameters: [
205
- Parameters.endpoint,
206
- Parameters.apiVersion,
207
- Parameters.jobId1
208
- ],
209
- headerParameters: [Parameters.accept],
210
- serializer
211
- };
212
- const healthOperationSpec = {
213
- path: "/entities/health/jobs",
214
- httpMethod: "POST",
215
- responses: {
216
- 202: {
217
- headersMapper: Mappers.GeneratedClientHealthHeaders
218
- },
219
- default: {
220
- bodyMapper: Mappers.ErrorResponse
221
- }
222
- },
223
- requestBody: Parameters.input,
224
- queryParameters: [
225
- Parameters.modelVersion,
226
- Parameters.stringIndexType,
227
- Parameters.loggingOptOut
228
- ],
229
- urlParameters: [Parameters.endpoint, Parameters.apiVersion],
230
- headerParameters: [Parameters.contentType, Parameters.accept],
231
- mediaType: "json",
232
- serializer
233
- };
234
- const entitiesRecognitionGeneralOperationSpec = {
235
- path: "/entities/recognition/general",
236
- httpMethod: "POST",
237
- responses: {
238
- 200: {
239
- bodyMapper: Mappers.EntitiesResult
240
- },
241
- default: {
242
- bodyMapper: Mappers.ErrorResponse
243
- }
244
- },
245
- requestBody: Parameters.input,
246
- queryParameters: [
247
- Parameters.includeStatistics,
248
- Parameters.modelVersion,
249
- Parameters.stringIndexType,
250
- Parameters.loggingOptOut
251
- ],
252
- urlParameters: [Parameters.endpoint, Parameters.apiVersion],
253
- headerParameters: [Parameters.contentType, Parameters.accept],
254
- mediaType: "json",
255
- serializer
256
- };
257
- const entitiesRecognitionPiiOperationSpec = {
258
- path: "/entities/recognition/pii",
259
- httpMethod: "POST",
260
- responses: {
261
- 200: {
262
- bodyMapper: Mappers.PiiResult
263
- },
264
- default: {
265
- bodyMapper: Mappers.ErrorResponse
266
- }
267
- },
268
- requestBody: Parameters.input,
269
- queryParameters: [
270
- Parameters.includeStatistics,
271
- Parameters.modelVersion,
272
- Parameters.stringIndexType,
273
- Parameters.loggingOptOut,
274
- Parameters.domain,
275
- Parameters.piiCategories
276
- ],
277
- urlParameters: [Parameters.endpoint, Parameters.apiVersion],
278
- headerParameters: [Parameters.contentType, Parameters.accept],
279
- mediaType: "json",
280
- serializer
281
- };
282
- const entitiesLinkingOperationSpec = {
283
- path: "/entities/linking",
284
- httpMethod: "POST",
285
- responses: {
286
- 200: {
287
- bodyMapper: Mappers.EntityLinkingResult
288
- },
289
- default: {
290
- bodyMapper: Mappers.ErrorResponse
291
- }
292
- },
293
- requestBody: Parameters.input,
294
- queryParameters: [
295
- Parameters.includeStatistics,
296
- Parameters.modelVersion,
297
- Parameters.stringIndexType,
298
- Parameters.loggingOptOut
299
- ],
300
- urlParameters: [Parameters.endpoint, Parameters.apiVersion],
301
- headerParameters: [Parameters.contentType, Parameters.accept],
302
- mediaType: "json",
303
- serializer
304
- };
305
- const keyPhrasesOperationSpec = {
306
- path: "/keyPhrases",
307
- httpMethod: "POST",
308
- responses: {
309
- 200: {
310
- bodyMapper: Mappers.KeyPhraseResult
311
- },
312
- default: {
313
- bodyMapper: Mappers.ErrorResponse
314
- }
315
- },
316
- requestBody: Parameters.input,
317
- queryParameters: [
318
- Parameters.includeStatistics,
319
- Parameters.modelVersion,
320
- Parameters.loggingOptOut
321
- ],
322
- urlParameters: [Parameters.endpoint, Parameters.apiVersion],
323
- headerParameters: [Parameters.contentType, Parameters.accept],
324
- mediaType: "json",
325
- serializer
326
- };
327
- const languagesOperationSpec = {
328
- path: "/languages",
329
- httpMethod: "POST",
330
- responses: {
331
- 200: {
332
- bodyMapper: Mappers.LanguageResult
333
- },
334
- default: {
335
- bodyMapper: Mappers.ErrorResponse
336
- }
337
- },
338
- requestBody: Parameters.input1,
339
- queryParameters: [
340
- Parameters.includeStatistics,
341
- Parameters.modelVersion,
342
- Parameters.loggingOptOut
343
- ],
344
- urlParameters: [Parameters.endpoint, Parameters.apiVersion],
345
- headerParameters: [Parameters.contentType, Parameters.accept],
346
- mediaType: "json",
347
- serializer
348
- };
349
- const sentimentOperationSpec = {
350
- path: "/sentiment",
351
- httpMethod: "POST",
352
- responses: {
353
- 200: {
354
- bodyMapper: Mappers.SentimentResponse
355
- },
356
- default: {
357
- bodyMapper: Mappers.ErrorResponse
358
- }
359
- },
360
- requestBody: Parameters.input,
361
- queryParameters: [
362
- Parameters.includeStatistics,
363
- Parameters.modelVersion,
364
- Parameters.stringIndexType,
365
- Parameters.loggingOptOut,
366
- Parameters.opinionMining
367
- ],
368
- urlParameters: [Parameters.endpoint, Parameters.apiVersion],
112
+ requestBody: Parameters.body,
113
+ queryParameters: [Parameters.apiVersion, Parameters.includeStatistics],
114
+ urlParameters: [Parameters.endpoint],
369
115
  headerParameters: [Parameters.contentType, Parameters.accept],
370
116
  mediaType: "json",
371
117
  serializer
@@ -1 +1 @@
1
- {"version":3,"file":"generatedClient.js","sourceRoot":"","sources":["../../../src/generated/generatedClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AA6BlE,gBAAgB;AAChB,MAAM,OAAO,eAAgB,SAAQ,sBAAsB;IACzD;;;;;OAKG;IACH,YAAY,QAAgB,EAAE,OAAuC;QACnE,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACH,OAAO,CACL,OAA8C;QAE9C,OAAO,IAAI,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,EAAE,oBAAoB,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;OAMG;IACH,aAAa,CACX,KAAa,EACb,OAAoD;QAEpD,OAAO,IAAI,CAAC,oBAAoB,CAC9B,EAAE,KAAK,EAAE,OAAO,EAAE,EAClB,0BAA0B,CAC3B,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,YAAY,CACV,KAAa,EACb,OAAmD;QAEnD,OAAO,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code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport { GeneratedClientContext } from \"./generatedClientContext\";\nimport {\n GeneratedClientOptionalParams,\n GeneratedClientAnalyzeOptionalParams,\n GeneratedClientAnalyzeResponse,\n GeneratedClientAnalyzeStatusOptionalParams,\n GeneratedClientAnalyzeStatusResponse,\n GeneratedClientHealthStatusOptionalParams,\n GeneratedClientHealthStatusResponse,\n GeneratedClientCancelHealthJobOptionalParams,\n GeneratedClientCancelHealthJobResponse,\n MultiLanguageBatchInput,\n GeneratedClientHealthOptionalParams,\n GeneratedClientHealthResponse,\n GeneratedClientEntitiesRecognitionGeneralOptionalParams,\n GeneratedClientEntitiesRecognitionGeneralResponse,\n GeneratedClientEntitiesRecognitionPiiOptionalParams,\n GeneratedClientEntitiesRecognitionPiiResponse,\n GeneratedClientEntitiesLinkingOptionalParams,\n GeneratedClientEntitiesLinkingResponse,\n GeneratedClientKeyPhrasesOptionalParams,\n GeneratedClientKeyPhrasesResponse,\n LanguageBatchInput,\n GeneratedClientLanguagesOptionalParams,\n GeneratedClientLanguagesResponse,\n GeneratedClientSentimentOptionalParams,\n GeneratedClientSentimentResponse\n} from \"./models\";\n\n/** @internal */\nexport class GeneratedClient extends GeneratedClientContext {\n /**\n * Initializes a new instance of the GeneratedClient class.\n * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example:\n * https://westus.api.cognitive.microsoft.com).\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: GeneratedClientOptionalParams) {\n super(endpoint, options);\n }\n\n /**\n * Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed.\n * @param options The options parameters.\n */\n analyze(\n options?: GeneratedClientAnalyzeOptionalParams\n ): Promise<GeneratedClientAnalyzeResponse> {\n return this.sendOperationRequest({ options }, analyzeOperationSpec);\n }\n\n /**\n * Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are\n * completed, the job will transition to the completed state and results will be available for each\n * task.\n * @param jobId Job ID for Analyze\n * @param options The options parameters.\n */\n analyzeStatus(\n jobId: string,\n options?: GeneratedClientAnalyzeStatusOptionalParams\n ): Promise<GeneratedClientAnalyzeStatusResponse> {\n return this.sendOperationRequest(\n { jobId, options },\n analyzeStatusOperationSpec\n );\n }\n\n /**\n * Get details of the healthcare prediction job specified by the jobId.\n * @param jobId Job ID\n * @param options The options parameters.\n */\n healthStatus(\n jobId: string,\n options?: GeneratedClientHealthStatusOptionalParams\n ): Promise<GeneratedClientHealthStatusResponse> {\n return this.sendOperationRequest(\n { jobId, options },\n healthStatusOperationSpec\n );\n }\n\n /**\n * Cancel healthcare prediction job.\n * @param jobId Job ID\n * @param options The options parameters.\n */\n cancelHealthJob(\n jobId: string,\n options?: GeneratedClientCancelHealthJobOptionalParams\n ): Promise<GeneratedClientCancelHealthJobResponse> {\n return this.sendOperationRequest(\n { jobId, options },\n cancelHealthJobOperationSpec\n );\n }\n\n /**\n * Start a healthcare analysis job to recognize healthcare related entities (drugs, conditions,\n * symptoms, etc) and their relations.\n * @param input Collection of documents to analyze.\n * @param options The options parameters.\n */\n health(\n input: MultiLanguageBatchInput,\n options?: GeneratedClientHealthOptionalParams\n ): Promise<GeneratedClientHealthResponse> {\n return this.sendOperationRequest({ input, options }, healthOperationSpec);\n }\n\n /**\n * The API returns a list of general named entities in a given document. For the list of supported\n * entity types, check <a href=\"https://aka.ms/taner\">Supported Entity Types in Text Analytics API</a>.\n * See the <a href=\"https://aka.ms/talangs\">Supported languages in Text Analytics API</a> for the list\n * of enabled languages.\n * @param input Collection of documents to analyze.\n * @param options The options parameters.\n */\n entitiesRecognitionGeneral(\n input: MultiLanguageBatchInput,\n options?: GeneratedClientEntitiesRecognitionGeneralOptionalParams\n ): Promise<GeneratedClientEntitiesRecognitionGeneralResponse> {\n return this.sendOperationRequest(\n { input, options },\n entitiesRecognitionGeneralOperationSpec\n );\n }\n\n /**\n * The API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in the\n * document. For the list of supported entity types, check <a href=\"https://aka.ms/tanerpii\">Supported\n * Entity Types in Text Analytics API</a>. See the <a href=\"https://aka.ms/talangs\">Supported languages\n * in Text Analytics API</a> for the list of enabled languages.\n *\n * @param input Collection of documents to analyze.\n * @param options The options parameters.\n */\n entitiesRecognitionPii(\n input: MultiLanguageBatchInput,\n options?: GeneratedClientEntitiesRecognitionPiiOptionalParams\n ): Promise<GeneratedClientEntitiesRecognitionPiiResponse> {\n return this.sendOperationRequest(\n { input, options },\n entitiesRecognitionPiiOperationSpec\n );\n }\n\n /**\n * The API returns a list of recognized entities with links to a well known knowledge base. See the <a\n * href=\"https://aka.ms/talangs\">Supported languages in Text Analytics API</a> for the list of enabled\n * languages.\n * @param input Collection of documents to analyze.\n * @param options The options parameters.\n */\n entitiesLinking(\n input: MultiLanguageBatchInput,\n options?: GeneratedClientEntitiesLinkingOptionalParams\n ): Promise<GeneratedClientEntitiesLinkingResponse> {\n return this.sendOperationRequest(\n { input, options },\n entitiesLinkingOperationSpec\n );\n }\n\n /**\n * The API returns a list of strings denoting the key phrases in the input text. See the <a\n * href=\"https://aka.ms/talangs\">Supported languages in Text Analytics API</a> for the list of enabled\n * languages.\n * @param input Collection of documents to analyze.\n * @param options The options parameters.\n */\n keyPhrases(\n input: MultiLanguageBatchInput,\n options?: GeneratedClientKeyPhrasesOptionalParams\n ): Promise<GeneratedClientKeyPhrasesResponse> {\n return this.sendOperationRequest(\n { input, options },\n keyPhrasesOperationSpec\n );\n }\n\n /**\n * The API returns the detected language and a numeric score between 0 and 1. Scores close to 1\n * indicate 100% certainty that the identified language is true. See the <a\n * href=\"https://aka.ms/talangs\">Supported languages in Text Analytics API</a> for the list of enabled\n * languages.\n * @param input Collection of documents to analyze for language endpoint.\n * @param options The options parameters.\n */\n languages(\n input: LanguageBatchInput,\n options?: GeneratedClientLanguagesOptionalParams\n ): Promise<GeneratedClientLanguagesResponse> {\n return this.sendOperationRequest(\n { input, options },\n languagesOperationSpec\n );\n }\n\n /**\n * The API returns a detailed sentiment analysis for the input text. The analysis is done in multiple\n * levels of granularity, start from the a document level, down to sentence and key terms (targets and\n * assessments).\n * @param input Collection of documents to analyze.\n * @param options The options parameters.\n */\n sentiment(\n input: MultiLanguageBatchInput,\n options?: GeneratedClientSentimentOptionalParams\n ): Promise<GeneratedClientSentimentResponse> {\n return this.sendOperationRequest(\n { input, options },\n sentimentOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst analyzeOperationSpec: coreClient.OperationSpec = {\n path: \"/analyze\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.GeneratedClientAnalyzeHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.body,\n urlParameters: [Parameters.endpoint, Parameters.apiVersion],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst analyzeStatusOperationSpec: coreClient.OperationSpec = {\n path: \"/analyze/jobs/{jobId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeJobState\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [\n Parameters.includeStatistics,\n Parameters.top,\n Parameters.skip\n ],\n urlParameters: [Parameters.endpoint, Parameters.apiVersion, Parameters.jobId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst healthStatusOperationSpec: coreClient.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: [\n Parameters.includeStatistics,\n Parameters.top,\n Parameters.skip\n ],\n urlParameters: [\n Parameters.endpoint,\n Parameters.apiVersion,\n Parameters.jobId1\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst cancelHealthJobOperationSpec: coreClient.OperationSpec = {\n path: \"/entities/health/jobs/{jobId}\",\n httpMethod: \"DELETE\",\n responses: {\n 202: {\n headersMapper: Mappers.GeneratedClientCancelHealthJobHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n urlParameters: [\n Parameters.endpoint,\n Parameters.apiVersion,\n Parameters.jobId1\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst healthOperationSpec: coreClient.OperationSpec = {\n path: \"/entities/health/jobs\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.GeneratedClientHealthHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.input,\n queryParameters: [\n Parameters.modelVersion,\n Parameters.stringIndexType,\n Parameters.loggingOptOut\n ],\n urlParameters: [Parameters.endpoint, Parameters.apiVersion],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst entitiesRecognitionGeneralOperationSpec: coreClient.OperationSpec = {\n path: \"/entities/recognition/general\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.EntitiesResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.input,\n queryParameters: [\n Parameters.includeStatistics,\n Parameters.modelVersion,\n Parameters.stringIndexType,\n Parameters.loggingOptOut\n ],\n urlParameters: [Parameters.endpoint, Parameters.apiVersion],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst entitiesRecognitionPiiOperationSpec: coreClient.OperationSpec = {\n path: \"/entities/recognition/pii\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.PiiResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.input,\n queryParameters: [\n Parameters.includeStatistics,\n Parameters.modelVersion,\n Parameters.stringIndexType,\n Parameters.loggingOptOut,\n Parameters.domain,\n Parameters.piiCategories\n ],\n urlParameters: [Parameters.endpoint, Parameters.apiVersion],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst entitiesLinkingOperationSpec: coreClient.OperationSpec = {\n path: \"/entities/linking\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.EntityLinkingResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.input,\n queryParameters: [\n Parameters.includeStatistics,\n Parameters.modelVersion,\n Parameters.stringIndexType,\n Parameters.loggingOptOut\n ],\n urlParameters: [Parameters.endpoint, Parameters.apiVersion],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst keyPhrasesOperationSpec: coreClient.OperationSpec = {\n path: \"/keyPhrases\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyPhraseResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.input,\n queryParameters: [\n Parameters.includeStatistics,\n Parameters.modelVersion,\n Parameters.loggingOptOut\n ],\n urlParameters: [Parameters.endpoint, Parameters.apiVersion],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst languagesOperationSpec: coreClient.OperationSpec = {\n path: \"/languages\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.LanguageResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.input1,\n queryParameters: [\n Parameters.includeStatistics,\n Parameters.modelVersion,\n Parameters.loggingOptOut\n ],\n urlParameters: [Parameters.endpoint, Parameters.apiVersion],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst sentimentOperationSpec: coreClient.OperationSpec = {\n path: \"/sentiment\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.SentimentResponse\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.input,\n queryParameters: [\n Parameters.includeStatistics,\n Parameters.modelVersion,\n Parameters.stringIndexType,\n Parameters.loggingOptOut,\n Parameters.opinionMining\n ],\n urlParameters: [Parameters.endpoint, Parameters.apiVersion],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\n"]}
1
+ {"version":3,"file":"generatedClient.js","sourceRoot":"","sources":["../../../src/generated/generatedClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAM9D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAQ5C,gBAAgB;AAChB,MAAM,OAAO,eAAgB,SAAQ,UAAU,CAAC,aAAa;IAI3D;;;;;OAKG;IACH,YAAY,QAAgB,EAAE,OAAuC;;QACnE,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAC9C;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;QACD,MAAM,QAAQ,GAAkC;YAC9C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,yCAAyC,CAAC;QACjE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gB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;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,qBAAqB;SAC1C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,WAAW,EAAE,UAAU,CAAC,IAAI;IAC5B,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,iBAAiB,CAAC;IACtE,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport { AnalyzeTextImpl } from \"./operations\";\nimport { AnalyzeText } from \"./operationsInterfaces\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n GeneratedClientOptionalParams,\n AnalyzeActionUnion,\n AnalyzeOptionalParams,\n AnalyzeResponse\n} from \"./models\";\n\n/** @internal */\nexport class GeneratedClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the GeneratedClient class.\n * @param endpoint Supported Cognitive Services endpoint (e.g.,\n * https://<resource-name>.api.cognitiveservices.azure.com).\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: GeneratedClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: GeneratedClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-ai-text-analytics/6.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{Endpoint}/language\"\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n }\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2022-04-01-preview\";\n this.analyzeText = new AnalyzeTextImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return item.replace(/(?<==).*$/, apiVersion);\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n /**\n * Submit a collection of text documents for analysis. Specify a single unique task to be executed\n * immediately.\n * @param body Collection of documents to analyze and a single task to execute.\n * @param options The options parameters.\n */\n analyze(\n body: AnalyzeActionUnion,\n options?: AnalyzeOptionalParams\n ): Promise<AnalyzeResponse> {\n return this.sendOperationRequest({ body, options }, analyzeOperationSpec);\n }\n\n analyzeText: AnalyzeText;\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst analyzeOperationSpec: coreClient.OperationSpec = {\n path: \"/:analyze-text\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeTextTaskResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.body,\n queryParameters: [Parameters.apiVersion, Parameters.includeStatistics],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\n"]}
@@ -7,5 +7,5 @@
7
7
  */
8
8
  export * from "./models";
9
9
  export { GeneratedClient } from "./generatedClient";
10
- export { GeneratedClientContext } from "./generatedClientContext";
10
+ export * from "./operationsInterfaces";
11
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport * from \"./models\";\nexport { GeneratedClient } from \"./generatedClient\";\nexport { GeneratedClientContext } from \"./generatedClientContext\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,wBAAwB,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport * from \"./models\";\nexport { GeneratedClient } from \"./generatedClient\";\nexport * from \"./operationsInterfaces\";\n"]}