@azure/ai-language-conversations 1.0.0-beta.1 → 1.0.0-beta.2
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/LICENSE +4 -4
- package/README.md +15 -11
- package/{types/src → dist/browser}/azureKeyCredentialPolicy.d.ts +2 -2
- package/dist/browser/azureKeyCredentialPolicy.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/azureKeyCredentialPolicy.js +1 -1
- package/dist/browser/azureKeyCredentialPolicy.js.map +1 -0
- package/{dist-esm/src → dist/browser}/constants.js +1 -1
- package/{dist-esm/src → dist/browser}/constants.js.map +1 -1
- package/{types/src → dist/browser}/conversationAnalysisClient.d.ts +6 -8
- package/dist/browser/conversationAnalysisClient.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/conversationAnalysisClient.js +8 -10
- package/dist/browser/conversationAnalysisClient.js.map +1 -0
- package/{types/src → dist/browser}/generated/conversationAnalysisClient.d.ts +1 -1
- package/dist/browser/generated/conversationAnalysisClient.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/conversationAnalysisClient.js +25 -14
- package/{dist-esm/src → dist/browser}/generated/conversationAnalysisClient.js.map +1 -1
- package/dist/browser/generated/index.d.ts +3 -0
- package/{types/src → dist/browser}/generated/index.d.ts.map +1 -1
- package/{dist-esm/src → dist/browser}/generated/index.js +2 -2
- package/dist/browser/generated/index.js.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/lroImpl.js +11 -3
- package/dist/browser/generated/lroImpl.js.map +1 -0
- package/{types/src → dist/browser}/generated/models/index.d.ts +46 -46
- package/dist/browser/generated/models/index.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/models/mappers.js +297 -117
- package/dist/browser/generated/models/mappers.js.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/models/parameters.js +1 -1
- package/{dist-esm/src → dist/browser}/generated/models/parameters.js.map +1 -1
- package/{types/src → dist/browser}/index.d.ts +3 -3
- package/{types/src → dist/browser}/index.d.ts.map +1 -1
- package/{dist-esm/src → dist/browser}/index.js +4 -4
- package/dist/browser/index.js.map +1 -0
- package/{types/src → dist/browser}/models.d.ts +47 -47
- package/dist/browser/models.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/models.js +0 -2
- package/dist/browser/models.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/commonjs/azureKeyCredentialPolicy.d.ts +9 -0
- package/dist/commonjs/azureKeyCredentialPolicy.d.ts.map +1 -0
- package/dist/commonjs/azureKeyCredentialPolicy.js +25 -0
- package/dist/commonjs/azureKeyCredentialPolicy.js.map +1 -0
- package/dist/commonjs/constants.d.ts +3 -0
- package/dist/commonjs/constants.d.ts.map +1 -0
- package/dist/commonjs/constants.js +8 -0
- package/dist/commonjs/constants.js.map +1 -0
- package/dist/commonjs/conversationAnalysisClient.d.ts +63 -0
- package/dist/commonjs/conversationAnalysisClient.d.ts.map +1 -0
- package/dist/commonjs/conversationAnalysisClient.js +85 -0
- package/dist/commonjs/conversationAnalysisClient.js.map +1 -0
- package/dist/commonjs/generated/conversationAnalysisClient.d.ts +36 -0
- package/dist/commonjs/generated/conversationAnalysisClient.d.ts.map +1 -0
- package/dist/commonjs/generated/conversationAnalysisClient.js +207 -0
- package/dist/commonjs/generated/conversationAnalysisClient.js.map +1 -0
- package/dist/commonjs/generated/index.d.ts +3 -0
- package/dist/commonjs/generated/index.d.ts.map +1 -0
- package/dist/commonjs/generated/index.js +15 -0
- package/dist/commonjs/generated/index.js.map +1 -0
- package/dist/commonjs/generated/lroImpl.d.ts +16 -0
- package/dist/commonjs/generated/lroImpl.d.ts.map +1 -0
- package/dist/commonjs/generated/lroImpl.js +37 -0
- package/dist/commonjs/generated/lroImpl.js.map +1 -0
- package/dist/commonjs/generated/models/index.d.ts +1951 -0
- package/dist/commonjs/generated/models/index.d.ts.map +1 -0
- package/dist/commonjs/generated/models/index.js +659 -0
- package/dist/commonjs/generated/models/index.js.map +1 -0
- package/dist/commonjs/generated/models/mappers.d.ts +153 -0
- package/dist/commonjs/generated/models/mappers.d.ts.map +1 -0
- package/dist/commonjs/generated/models/mappers.js +2847 -0
- package/dist/commonjs/generated/models/mappers.js.map +1 -0
- package/dist/commonjs/generated/models/parameters.d.ts +8 -0
- package/dist/commonjs/generated/models/parameters.d.ts.map +1 -0
- package/dist/commonjs/generated/models/parameters.js +64 -0
- package/dist/commonjs/generated/models/parameters.js.map +1 -0
- package/dist/commonjs/index.d.ts +13 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +21 -0
- package/dist/commonjs/index.js.map +1 -0
- package/{types/ai-language-conversations.d.ts → dist/commonjs/models.d.ts} +1953 -2221
- package/dist/commonjs/models.d.ts.map +1 -0
- package/dist/commonjs/models.js +652 -0
- package/dist/commonjs/models.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/{types → dist/commonjs}/tsdoc-metadata.json +11 -11
- package/dist/esm/azureKeyCredentialPolicy.d.ts +9 -0
- package/dist/esm/azureKeyCredentialPolicy.d.ts.map +1 -0
- package/dist/esm/azureKeyCredentialPolicy.js +22 -0
- package/dist/esm/azureKeyCredentialPolicy.js.map +1 -0
- package/dist/esm/constants.d.ts +3 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +5 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/conversationAnalysisClient.d.ts +63 -0
- package/dist/esm/conversationAnalysisClient.d.ts.map +1 -0
- package/dist/esm/conversationAnalysisClient.js +81 -0
- package/dist/esm/conversationAnalysisClient.js.map +1 -0
- package/dist/esm/generated/conversationAnalysisClient.d.ts +36 -0
- package/dist/esm/generated/conversationAnalysisClient.d.ts.map +1 -0
- package/dist/esm/generated/conversationAnalysisClient.js +202 -0
- package/dist/esm/generated/conversationAnalysisClient.js.map +1 -0
- package/dist/esm/generated/index.d.ts +3 -0
- package/dist/esm/generated/index.d.ts.map +1 -0
- package/dist/esm/generated/index.js +10 -0
- package/dist/esm/generated/index.js.map +1 -0
- package/dist/esm/generated/lroImpl.d.ts +16 -0
- package/dist/esm/generated/lroImpl.d.ts.map +1 -0
- package/dist/esm/generated/lroImpl.js +33 -0
- package/dist/esm/generated/lroImpl.js.map +1 -0
- package/dist/esm/generated/models/index.d.ts +1951 -0
- package/dist/esm/generated/models/index.d.ts.map +1 -0
- package/dist/esm/generated/models/index.js +656 -0
- package/dist/esm/generated/models/index.js.map +1 -0
- package/dist/esm/generated/models/mappers.d.ts +153 -0
- package/dist/esm/generated/models/mappers.d.ts.map +1 -0
- package/dist/{index.js → esm/generated/models/mappers.js} +404 -1395
- package/dist/esm/generated/models/mappers.js.map +1 -0
- package/dist/esm/generated/models/parameters.d.ts +8 -0
- package/dist/esm/generated/models/parameters.d.ts.map +1 -0
- package/dist/esm/generated/models/parameters.js +61 -0
- package/dist/esm/generated/models/parameters.js.map +1 -0
- package/dist/esm/index.d.ts +13 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/models.d.ts +1953 -0
- package/dist/esm/models.d.ts.map +1 -0
- package/dist/esm/models.js +649 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/react-native/azureKeyCredentialPolicy.d.ts +9 -0
- package/dist/react-native/azureKeyCredentialPolicy.d.ts.map +1 -0
- package/dist/react-native/azureKeyCredentialPolicy.js +22 -0
- package/dist/react-native/azureKeyCredentialPolicy.js.map +1 -0
- package/dist/react-native/constants.d.ts +3 -0
- package/dist/react-native/constants.d.ts.map +1 -0
- package/dist/react-native/constants.js +5 -0
- package/dist/react-native/constants.js.map +1 -0
- package/dist/react-native/conversationAnalysisClient.d.ts +63 -0
- package/dist/react-native/conversationAnalysisClient.d.ts.map +1 -0
- package/dist/react-native/conversationAnalysisClient.js +81 -0
- package/dist/react-native/conversationAnalysisClient.js.map +1 -0
- package/dist/react-native/generated/conversationAnalysisClient.d.ts +36 -0
- package/dist/react-native/generated/conversationAnalysisClient.d.ts.map +1 -0
- package/dist/react-native/generated/conversationAnalysisClient.js +202 -0
- package/dist/react-native/generated/conversationAnalysisClient.js.map +1 -0
- package/dist/react-native/generated/index.d.ts +3 -0
- package/dist/react-native/generated/index.d.ts.map +1 -0
- package/dist/react-native/generated/index.js +10 -0
- package/dist/react-native/generated/index.js.map +1 -0
- package/dist/react-native/generated/lroImpl.d.ts +16 -0
- package/dist/react-native/generated/lroImpl.d.ts.map +1 -0
- package/dist/react-native/generated/lroImpl.js +33 -0
- package/dist/react-native/generated/lroImpl.js.map +1 -0
- package/dist/react-native/generated/models/index.d.ts +1951 -0
- package/dist/react-native/generated/models/index.d.ts.map +1 -0
- package/dist/react-native/generated/models/index.js +656 -0
- package/dist/react-native/generated/models/index.js.map +1 -0
- package/dist/react-native/generated/models/mappers.d.ts +153 -0
- package/dist/react-native/generated/models/mappers.d.ts.map +1 -0
- package/dist/react-native/generated/models/mappers.js +2842 -0
- package/dist/react-native/generated/models/mappers.js.map +1 -0
- package/dist/react-native/generated/models/parameters.d.ts +8 -0
- package/dist/react-native/generated/models/parameters.d.ts.map +1 -0
- package/dist/react-native/generated/models/parameters.js +61 -0
- package/dist/react-native/generated/models/parameters.js.map +1 -0
- package/dist/react-native/index.d.ts +13 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +15 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/models.d.ts +1953 -0
- package/dist/react-native/models.d.ts.map +1 -0
- package/dist/react-native/models.js +649 -0
- package/dist/react-native/models.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/package.json +95 -100
- package/CHANGELOG.md +0 -5
- package/dist/index.js.map +0 -1
- package/dist-esm/samples-dev/sample_analyze_conversation_app.js +0 -74
- package/dist-esm/samples-dev/sample_analyze_conversation_app.js.map +0 -1
- package/dist-esm/samples-dev/sample_analyze_orchestration_app_conv_response.js +0 -89
- package/dist-esm/samples-dev/sample_analyze_orchestration_app_conv_response.js.map +0 -1
- package/dist-esm/samples-dev/sample_analyze_orchestration_app_luis_response.js +0 -65
- package/dist-esm/samples-dev/sample_analyze_orchestration_app_luis_response.js.map +0 -1
- package/dist-esm/samples-dev/sample_analyze_orchestration_app_qna_response.js +0 -66
- package/dist-esm/samples-dev/sample_analyze_orchestration_app_qna_response.js.map +0 -1
- package/dist-esm/samples-dev/sample_analyze_orchestration_direct_target.js +0 -76
- package/dist-esm/samples-dev/sample_analyze_orchestration_direct_target.js.map +0 -1
- package/dist-esm/samples-dev/sample_authentication.js +0 -44
- package/dist-esm/samples-dev/sample_authentication.js.map +0 -1
- package/dist-esm/samples-dev/sample_conv_pii_transcript_input.js +0 -112
- package/dist-esm/samples-dev/sample_conv_pii_transcript_input.js.map +0 -1
- package/dist-esm/samples-dev/sample_conv_summarization.js +0 -95
- package/dist-esm/samples-dev/sample_conv_summarization.js.map +0 -1
- package/dist-esm/src/azureKeyCredentialPolicy.js.map +0 -1
- package/dist-esm/src/conversationAnalysisClient.js.map +0 -1
- package/dist-esm/src/generated/index.js.map +0 -1
- package/dist-esm/src/generated/lroImpl.js.map +0 -1
- package/dist-esm/src/generated/models/mappers.js.map +0 -1
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/models.js.map +0 -1
- package/dist-esm/test/public/analyze.spec.js +0 -159
- package/dist-esm/test/public/analyze.spec.js.map +0 -1
- package/dist-esm/test/public/inputs.js +0 -166
- package/dist-esm/test/public/inputs.js.map +0 -1
- package/dist-esm/test/public/utils/recordedClient.js +0 -50
- package/dist-esm/test/public/utils/recordedClient.js.map +0 -1
- package/review/ai-language-conversations.api.md +0 -1291
- package/rollup.config.js +0 -122
- package/tsconfig.json +0 -11
- package/types/samples-dev/sample_analyze_conversation_app.d.ts +0 -2
- package/types/samples-dev/sample_analyze_conversation_app.d.ts.map +0 -1
- package/types/samples-dev/sample_analyze_orchestration_app_conv_response.d.ts +0 -2
- package/types/samples-dev/sample_analyze_orchestration_app_conv_response.d.ts.map +0 -1
- package/types/samples-dev/sample_analyze_orchestration_app_luis_response.d.ts +0 -2
- package/types/samples-dev/sample_analyze_orchestration_app_luis_response.d.ts.map +0 -1
- package/types/samples-dev/sample_analyze_orchestration_app_qna_response.d.ts +0 -2
- package/types/samples-dev/sample_analyze_orchestration_app_qna_response.d.ts.map +0 -1
- package/types/samples-dev/sample_analyze_orchestration_direct_target.d.ts +0 -2
- package/types/samples-dev/sample_analyze_orchestration_direct_target.d.ts.map +0 -1
- package/types/samples-dev/sample_authentication.d.ts +0 -2
- package/types/samples-dev/sample_authentication.d.ts.map +0 -1
- package/types/samples-dev/sample_conv_pii_transcript_input.d.ts +0 -2
- package/types/samples-dev/sample_conv_pii_transcript_input.d.ts.map +0 -1
- package/types/samples-dev/sample_conv_summarization.d.ts +0 -2
- package/types/samples-dev/sample_conv_summarization.d.ts.map +0 -1
- package/types/src/azureKeyCredentialPolicy.d.ts.map +0 -1
- package/types/src/conversationAnalysisClient.d.ts.map +0 -1
- package/types/src/generated/conversationAnalysisClient.d.ts.map +0 -1
- package/types/src/generated/index.d.ts +0 -3
- package/types/src/generated/models/index.d.ts.map +0 -1
- package/types/src/models.d.ts.map +0 -1
- package/types/test/public/analyze.spec.d.ts +0 -2
- package/types/test/public/analyze.spec.d.ts.map +0 -1
- package/types/test/public/inputs.d.ts +0 -8
- package/types/test/public/inputs.d.ts.map +0 -1
- package/types/test/public/utils/recordedClient.d.ts +0 -16
- package/types/test/public/utils/recordedClient.d.ts.map +0 -1
- /package/{types/src → dist/browser}/constants.d.ts +0 -0
- /package/{types/src → dist/browser}/constants.d.ts.map +0 -0
- /package/{types/src → dist/browser}/generated/lroImpl.d.ts +0 -0
- /package/{types/src → dist/browser}/generated/lroImpl.d.ts.map +0 -0
- /package/{dist-esm/src → dist/browser}/generated/models/index.js +0 -0
- /package/{dist-esm/src → dist/browser}/generated/models/index.js.map +0 -0
- /package/{types/src → dist/browser}/generated/models/mappers.d.ts +0 -0
- /package/{types/src → dist/browser}/generated/models/mappers.d.ts.map +0 -0
- /package/{types/src → dist/browser}/generated/models/parameters.d.ts +0 -0
- /package/{types/src → dist/browser}/generated/models/parameters.d.ts.map +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PipelinePolicy } from "@azure/core-rest-pipeline";
|
|
2
|
+
import type { KeyCredential } from "@azure/core-auth";
|
|
3
|
+
/**
|
|
4
|
+
* Create an HTTP pipeline policy to authenticate a request
|
|
5
|
+
* using an `AzureKeyCredential` for Conversation Analysis
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function conversationAnalysisAzureKeyCredentialPolicy(credential: KeyCredential): PipelinePolicy;
|
|
9
|
+
//# sourceMappingURL=azureKeyCredentialPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azureKeyCredentialPolicy.d.ts","sourceRoot":"","sources":["../../src/azureKeyCredentialPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAUtD;;;;GAIG;AACH,wBAAgB,4CAA4C,CAC1D,UAAU,EAAE,aAAa,GACxB,cAAc,CAQhB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.conversationAnalysisAzureKeyCredentialPolicy = conversationAnalysisAzureKeyCredentialPolicy;
|
|
6
|
+
const API_KEY_HEADER_NAME = "Ocp-Apim-Subscription-Key";
|
|
7
|
+
/**
|
|
8
|
+
* The programmatic identifier of the conversationAnalysisAzureKeyCredentialPolicy.
|
|
9
|
+
*/
|
|
10
|
+
const conversationAnalysisAzureKeyCredentialPolicyName = "conversationAnalysisAzureKeyCredentialPolicy";
|
|
11
|
+
/**
|
|
12
|
+
* Create an HTTP pipeline policy to authenticate a request
|
|
13
|
+
* using an `AzureKeyCredential` for Conversation Analysis
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
function conversationAnalysisAzureKeyCredentialPolicy(credential) {
|
|
17
|
+
return {
|
|
18
|
+
name: conversationAnalysisAzureKeyCredentialPolicyName,
|
|
19
|
+
sendRequest(request, next) {
|
|
20
|
+
request.headers.set(API_KEY_HEADER_NAME, credential.key);
|
|
21
|
+
return next(request);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=azureKeyCredentialPolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azureKeyCredentialPolicy.js","sourceRoot":"","sources":["../../src/azureKeyCredentialPolicy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAuBlC,oGAUC;AAvBD,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AAExD;;GAEG;AACH,MAAM,gDAAgD,GACpD,8CAA8C,CAAC;AAEjD;;;;GAIG;AACH,SAAgB,4CAA4C,CAC1D,UAAyB;IAEzB,OAAO;QACL,IAAI,EAAE,gDAAgD;QACtD,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 type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport type { KeyCredential } from \"@azure/core-auth\";\n\nconst API_KEY_HEADER_NAME = \"Ocp-Apim-Subscription-Key\";\n\n/**\n * The programmatic identifier of the conversationAnalysisAzureKeyCredentialPolicy.\n */\nconst conversationAnalysisAzureKeyCredentialPolicyName =\n \"conversationAnalysisAzureKeyCredentialPolicy\";\n\n/**\n * Create an HTTP pipeline policy to authenticate a request\n * using an `AzureKeyCredential` for Conversation Analysis\n * @internal\n */\nexport function conversationAnalysisAzureKeyCredentialPolicy(\n credential: KeyCredential,\n): PipelinePolicy {\n return {\n name: conversationAnalysisAzureKeyCredentialPolicyName,\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 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,iDAAiD,CAAC;AACtF,eAAO,MAAM,WAAW,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.SDK_VERSION = exports.DEFAULT_COGNITIVE_SCOPE = void 0;
|
|
6
|
+
exports.DEFAULT_COGNITIVE_SCOPE = "https://cognitiveservices.azure.com/.default";
|
|
7
|
+
exports.SDK_VERSION = "1.0.0-beta.1";
|
|
8
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,uBAAuB,GAAG,8CAA8C,CAAC;AACzE,QAAA,WAAW,GAAG,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const DEFAULT_COGNITIVE_SCOPE = \"https://cognitiveservices.azure.com/.default\";\nexport const SDK_VERSION = \"1.0.0-beta.1\";\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { AnalyzeConversationJobsInput, AnalyzeConversationOptionalParams, AnalyzeConversationResponse, AnalyzeConversationTaskUnion, ConversationAnalysisClientOptionalParams, ConversationAnalysisOptionalParams, ConversationAnalysisResponse } from "./models.js";
|
|
2
|
+
import type { KeyCredential, TokenCredential } from "@azure/core-auth";
|
|
3
|
+
import type { PollOperationState, PollerLike } from "@azure/core-lro";
|
|
4
|
+
/**
|
|
5
|
+
* A client for interacting with the conversational language understanding
|
|
6
|
+
* features in Azure Cognitive Language Service.
|
|
7
|
+
*
|
|
8
|
+
* The client needs the endpoint of a Language resource and an authentication
|
|
9
|
+
* method such as an API key or AAD. The API key and endpoint can be found in
|
|
10
|
+
* the Language resource page in the Azure portal. They will be located in the
|
|
11
|
+
* resource's Keys and Endpoint page, under Resource Management.
|
|
12
|
+
*
|
|
13
|
+
* ### Examples for authentication:
|
|
14
|
+
*
|
|
15
|
+
* #### API Key
|
|
16
|
+
*
|
|
17
|
+
* ```ts snippet:ReadmeSampleCreateClient_Key
|
|
18
|
+
* import { AzureKeyCredential } from "@azure/core-auth";
|
|
19
|
+
* import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
|
|
20
|
+
*
|
|
21
|
+
* const endpoint = "https://<resource name>.cognitiveservices.azure.com";
|
|
22
|
+
* const credential = new AzureKeyCredential("<api key>");
|
|
23
|
+
* const client = new ConversationAnalysisClient(endpoint, credential);
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* #### Azure Active Directory
|
|
27
|
+
*
|
|
28
|
+
* See the [`@azure/identity`](https://npmjs.com/package/\@azure/identity)
|
|
29
|
+
* package for more information about authenticating with Azure Active Directory.
|
|
30
|
+
*
|
|
31
|
+
* ```ts snippet:ReadmeSampleCreateClient_ActiveDirectory
|
|
32
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
33
|
+
* import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
|
|
34
|
+
*
|
|
35
|
+
* const endpoint = "https://<resource name>.cognitiveservices.azure.com";
|
|
36
|
+
* const credential = new DefaultAzureCredential();
|
|
37
|
+
* const client = new ConversationAnalysisClient(endpoint, credential);
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare class ConversationAnalysisClient {
|
|
41
|
+
private readonly _client;
|
|
42
|
+
private readonly _tracing;
|
|
43
|
+
/**
|
|
44
|
+
* Initializes a new instance of the ConversationAnalysisClient class.
|
|
45
|
+
* @param endpoint - Supported Cognitive Services endpoint (e.g.,
|
|
46
|
+
* https://<resource-name>.api.cognitiveservices.azure.com).
|
|
47
|
+
* @param options - The parameter options
|
|
48
|
+
*/
|
|
49
|
+
constructor(endpoint: string, credential: TokenCredential | KeyCredential, options?: ConversationAnalysisClientOptionalParams);
|
|
50
|
+
/**
|
|
51
|
+
* Analyzes the input conversation utterance.
|
|
52
|
+
* @param task - A single conversational task to execute.
|
|
53
|
+
* @param options - The options parameters.
|
|
54
|
+
*/
|
|
55
|
+
analyzeConversation(task: AnalyzeConversationTaskUnion, options?: AnalyzeConversationOptionalParams): Promise<AnalyzeConversationResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.
|
|
58
|
+
* @param task - The collection of conversations to analyze and one or more tasks to execute.
|
|
59
|
+
* @param options - The options parameters.
|
|
60
|
+
*/
|
|
61
|
+
beginConversationAnalysis(task: AnalyzeConversationJobsInput, options?: ConversationAnalysisOptionalParams): Promise<PollerLike<PollOperationState<ConversationAnalysisResponse>, ConversationAnalysisResponse>>;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=conversationAnalysisClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversationAnalysisClient.d.ts","sourceRoot":"","sources":["../../src/conversationAnalysisClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,4BAA4B,EAC5B,iCAAiC,EACjC,2BAA2B,EAC3B,4BAA4B,EAC5B,wCAAwC,EACxC,kCAAkC,EAClC,4BAA4B,EAC7B,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAOtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IAEzC;;;;;OAKG;gBAED,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,eAAe,GAAG,aAAa,EAC3C,OAAO,GAAE,wCAA6C;IAiBxD;;;;OAIG;IACH,mBAAmB,CACjB,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,iCAAiC,GAC1C,OAAO,CAAC,2BAA2B,CAAC;IAYvC;;;;OAIG;IACG,yBAAyB,CAC7B,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,kCAAkC,GAC3C,OAAO,CACR,UAAU,CAAC,kBAAkB,CAAC,4BAA4B,CAAC,EAAE,4BAA4B,CAAC,CAC3F;CAUF"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConversationAnalysisClient = void 0;
|
|
4
|
+
const constants_js_1 = require("./constants.js");
|
|
5
|
+
const core_auth_1 = require("@azure/core-auth");
|
|
6
|
+
const core_tracing_1 = require("@azure/core-tracing");
|
|
7
|
+
const index_js_1 = require("./generated/index.js");
|
|
8
|
+
const core_rest_pipeline_1 = require("@azure/core-rest-pipeline");
|
|
9
|
+
const azureKeyCredentialPolicy_js_1 = require("./azureKeyCredentialPolicy.js");
|
|
10
|
+
/**
|
|
11
|
+
* A client for interacting with the conversational language understanding
|
|
12
|
+
* features in Azure Cognitive Language Service.
|
|
13
|
+
*
|
|
14
|
+
* The client needs the endpoint of a Language resource and an authentication
|
|
15
|
+
* method such as an API key or AAD. The API key and endpoint can be found in
|
|
16
|
+
* the Language resource page in the Azure portal. They will be located in the
|
|
17
|
+
* resource's Keys and Endpoint page, under Resource Management.
|
|
18
|
+
*
|
|
19
|
+
* ### Examples for authentication:
|
|
20
|
+
*
|
|
21
|
+
* #### API Key
|
|
22
|
+
*
|
|
23
|
+
* ```ts snippet:ReadmeSampleCreateClient_Key
|
|
24
|
+
* import { AzureKeyCredential } from "@azure/core-auth";
|
|
25
|
+
* import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
|
|
26
|
+
*
|
|
27
|
+
* const endpoint = "https://<resource name>.cognitiveservices.azure.com";
|
|
28
|
+
* const credential = new AzureKeyCredential("<api key>");
|
|
29
|
+
* const client = new ConversationAnalysisClient(endpoint, credential);
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* #### Azure Active Directory
|
|
33
|
+
*
|
|
34
|
+
* See the [`@azure/identity`](https://npmjs.com/package/\@azure/identity)
|
|
35
|
+
* package for more information about authenticating with Azure Active Directory.
|
|
36
|
+
*
|
|
37
|
+
* ```ts snippet:ReadmeSampleCreateClient_ActiveDirectory
|
|
38
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
39
|
+
* import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
|
|
40
|
+
*
|
|
41
|
+
* const endpoint = "https://<resource name>.cognitiveservices.azure.com";
|
|
42
|
+
* const credential = new DefaultAzureCredential();
|
|
43
|
+
* const client = new ConversationAnalysisClient(endpoint, credential);
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
class ConversationAnalysisClient {
|
|
47
|
+
_client;
|
|
48
|
+
_tracing;
|
|
49
|
+
/**
|
|
50
|
+
* Initializes a new instance of the ConversationAnalysisClient class.
|
|
51
|
+
* @param endpoint - Supported Cognitive Services endpoint (e.g.,
|
|
52
|
+
* https://<resource-name>.api.cognitiveservices.azure.com).
|
|
53
|
+
* @param options - The parameter options
|
|
54
|
+
*/
|
|
55
|
+
constructor(endpoint, credential, options = {}) {
|
|
56
|
+
this._client = new index_js_1.ConversationAnalysisClient(endpoint, options);
|
|
57
|
+
this._tracing = (0, core_tracing_1.createTracingClient)({
|
|
58
|
+
packageName: "@azure/ai-language-conversations",
|
|
59
|
+
packageVersion: constants_js_1.SDK_VERSION,
|
|
60
|
+
namespace: "Microsoft.CognitiveServices",
|
|
61
|
+
});
|
|
62
|
+
const authPolicy = (0, core_auth_1.isTokenCredential)(credential)
|
|
63
|
+
? (0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, scopes: constants_js_1.DEFAULT_COGNITIVE_SCOPE })
|
|
64
|
+
: (0, azureKeyCredentialPolicy_js_1.conversationAnalysisAzureKeyCredentialPolicy)(credential);
|
|
65
|
+
this._client.pipeline.addPolicy(authPolicy);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Analyzes the input conversation utterance.
|
|
69
|
+
* @param task - A single conversational task to execute.
|
|
70
|
+
* @param options - The options parameters.
|
|
71
|
+
*/
|
|
72
|
+
analyzeConversation(task, options) {
|
|
73
|
+
return this._tracing.withSpan("ConversationAnalysisClient.analyzeConversation", options || {}, (updatedOptions) => this._client.analyzeConversation(task, updatedOptions));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.
|
|
77
|
+
* @param task - The collection of conversations to analyze and one or more tasks to execute.
|
|
78
|
+
* @param options - The options parameters.
|
|
79
|
+
*/
|
|
80
|
+
async beginConversationAnalysis(task, options) {
|
|
81
|
+
return this._tracing.withSpan("ConversationAnalysisClient.beginConversationAnalysis", options || {}, (updatedOptions) => this._client.beginConversationAnalysis(task, updatedOptions));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.ConversationAnalysisClient = ConversationAnalysisClient;
|
|
85
|
+
//# sourceMappingURL=conversationAnalysisClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversationAnalysisClient.js","sourceRoot":"","sources":["../../src/conversationAnalysisClient.ts"],"names":[],"mappings":";;;AAWA,iDAAsE;AAEtE,gDAAqD;AAGrD,sDAA0D;AAC1D,mDAAqF;AACrF,kEAA4E;AAC5E,+EAA6F;AAE7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAa,0BAA0B;IACpB,OAAO,CAAkB;IACzB,QAAQ,CAAgB;IAEzC;;;;;OAKG;IACH,YACE,QAAgB,EAChB,UAA2C,EAC3C,UAAoD,EAAE;QAEtD,IAAI,CAAC,OAAO,GAAG,IAAI,qCAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAEtD,IAAI,CAAC,QAAQ,GAAG,IAAA,kCAAmB,EAAC;YAClC,WAAW,EAAE,kCAAkC;YAC/C,cAAc,EAAE,0BAAW;YAC3B,SAAS,EAAE,6BAA6B;SACzC,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,IAAA,6BAAiB,EAAC,UAAU,CAAC;YAC9C,CAAC,CAAC,IAAA,oDAA+B,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,sCAAuB,EAAE,CAAC;YAClF,CAAC,CAAC,IAAA,0EAA4C,EAAC,UAAU,CAAC,CAAC;QAE7D,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACH,mBAAmB,CACjB,IAAkC,EAClC,OAA2C;QAE3C,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAC3B,gDAAgD,EAChD,OAAO,IAAI,EAAE,EACb,CAAC,cAAc,EAAE,EAAE,CACjB,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAC9B,IAAI,EACJ,cAAc,CACyB,CAC5C,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,yBAAyB,CAC7B,IAAkC,EAClC,OAA4C;QAI5C,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAC3B,sDAAsD,EACtD,OAAO,IAAI,EAAE,EACb,CAAC,cAAc,EAAE,EAAE,CACjB,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,IAAI,EAAE,cAAc,CAE1D,CACJ,CAAC;IACJ,CAAC;CACF;AAtED,gEAsEC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type {\n AnalyzeConversationJobsInput,\n AnalyzeConversationOptionalParams,\n AnalyzeConversationResponse,\n AnalyzeConversationTaskUnion,\n ConversationAnalysisClientOptionalParams,\n ConversationAnalysisOptionalParams,\n ConversationAnalysisResponse,\n} from \"./models.js\";\nimport { DEFAULT_COGNITIVE_SCOPE, SDK_VERSION } from \"./constants.js\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { PollOperationState, PollerLike } from \"@azure/core-lro\";\nimport type { TracingClient } from \"@azure/core-tracing\";\nimport { createTracingClient } from \"@azure/core-tracing\";\nimport { ConversationAnalysisClient as GeneratedClient } from \"./generated/index.js\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport { conversationAnalysisAzureKeyCredentialPolicy } from \"./azureKeyCredentialPolicy.js\";\n\n/**\n * A client for interacting with the conversational language understanding\n * features in Azure Cognitive Language Service.\n *\n * The client needs the endpoint of a Language resource and an authentication\n * method such as an API key or AAD. The API key and endpoint can be found in\n * the Language resource page in the Azure portal. They will be located in the\n * resource's Keys and Endpoint page, under Resource Management.\n *\n * ### Examples for authentication:\n *\n * #### API Key\n *\n * ```ts snippet:ReadmeSampleCreateClient_Key\n * import { AzureKeyCredential } from \"@azure/core-auth\";\n * import { ConversationAnalysisClient } from \"@azure/ai-language-conversations\";\n *\n * const endpoint = \"https://<resource name>.cognitiveservices.azure.com\";\n * const credential = new AzureKeyCredential(\"<api key>\");\n * const client = new ConversationAnalysisClient(endpoint, credential);\n * ```\n *\n * #### Azure Active Directory\n *\n * See the [`@azure/identity`](https://npmjs.com/package/\\@azure/identity)\n * package for more information about authenticating with Azure Active Directory.\n *\n * ```ts snippet:ReadmeSampleCreateClient_ActiveDirectory\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { ConversationAnalysisClient } from \"@azure/ai-language-conversations\";\n *\n * const endpoint = \"https://<resource name>.cognitiveservices.azure.com\";\n * const credential = new DefaultAzureCredential();\n * const client = new ConversationAnalysisClient(endpoint, credential);\n * ```\n */\nexport class ConversationAnalysisClient {\n private readonly _client: GeneratedClient;\n private readonly _tracing: TracingClient;\n\n /**\n * Initializes a new instance of the ConversationAnalysisClient 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(\n endpoint: string,\n credential: TokenCredential | KeyCredential,\n options: ConversationAnalysisClientOptionalParams = {},\n ) {\n this._client = new GeneratedClient(endpoint, options);\n\n this._tracing = createTracingClient({\n packageName: \"@azure/ai-language-conversations\",\n packageVersion: SDK_VERSION,\n namespace: \"Microsoft.CognitiveServices\",\n });\n\n const authPolicy = isTokenCredential(credential)\n ? bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_COGNITIVE_SCOPE })\n : conversationAnalysisAzureKeyCredentialPolicy(credential);\n\n this._client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Analyzes the input conversation utterance.\n * @param task - A single conversational task to execute.\n * @param options - The options parameters.\n */\n analyzeConversation(\n task: AnalyzeConversationTaskUnion,\n options?: AnalyzeConversationOptionalParams,\n ): Promise<AnalyzeConversationResponse> {\n return this._tracing.withSpan(\n \"ConversationAnalysisClient.analyzeConversation\",\n options || {},\n (updatedOptions) =>\n this._client.analyzeConversation(\n task,\n updatedOptions,\n ) as Promise<AnalyzeConversationResponse>,\n );\n }\n\n /**\n * Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.\n * @param task - The collection of conversations to analyze and one or more tasks to execute.\n * @param options - The options parameters.\n */\n async beginConversationAnalysis(\n task: AnalyzeConversationJobsInput,\n options?: ConversationAnalysisOptionalParams,\n ): Promise<\n PollerLike<PollOperationState<ConversationAnalysisResponse>, ConversationAnalysisResponse>\n > {\n return this._tracing.withSpan(\n \"ConversationAnalysisClient.beginConversationAnalysis\",\n options || {},\n (updatedOptions) =>\n this._client.beginConversationAnalysis(task, updatedOptions) as Promise<\n PollerLike<PollOperationState<ConversationAnalysisResponse>, ConversationAnalysisResponse>\n >,\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as coreClient from "@azure/core-client";
|
|
2
|
+
import { PollerLike, PollOperationState } from "@azure/core-lro";
|
|
3
|
+
import { ConversationAnalysisClientOptionalParams, AnalyzeConversationTaskUnion, AnalyzeConversationOptionalParams, AnalyzeConversationResponse, AnalyzeConversationJobsInput, ConversationAnalysisOptionalParams, ConversationAnalysisResponse } from "./models/index.js";
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare class ConversationAnalysisClient extends coreClient.ServiceClient {
|
|
6
|
+
endpoint: string;
|
|
7
|
+
apiVersion: string;
|
|
8
|
+
/**
|
|
9
|
+
* Initializes a new instance of the ConversationAnalysisClient class.
|
|
10
|
+
* @param endpoint Supported Cognitive Services endpoint (e.g.,
|
|
11
|
+
* https://<resource-name>.api.cognitiveservices.azure.com).
|
|
12
|
+
* @param options The parameter options
|
|
13
|
+
*/
|
|
14
|
+
constructor(endpoint: string, options?: ConversationAnalysisClientOptionalParams);
|
|
15
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
16
|
+
private addCustomApiVersionPolicy;
|
|
17
|
+
/**
|
|
18
|
+
* Analyzes the input conversation utterance.
|
|
19
|
+
* @param task A single conversational task to execute.
|
|
20
|
+
* @param options The options parameters.
|
|
21
|
+
*/
|
|
22
|
+
analyzeConversation(task: AnalyzeConversationTaskUnion, options?: AnalyzeConversationOptionalParams): Promise<AnalyzeConversationResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.
|
|
25
|
+
* @param task The collection of conversations to analyze and one or more tasks to execute.
|
|
26
|
+
* @param options The options parameters.
|
|
27
|
+
*/
|
|
28
|
+
beginConversationAnalysis(task: AnalyzeConversationJobsInput, options?: ConversationAnalysisOptionalParams): Promise<PollerLike<PollOperationState<ConversationAnalysisResponse>, ConversationAnalysisResponse>>;
|
|
29
|
+
/**
|
|
30
|
+
* Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.
|
|
31
|
+
* @param task The collection of conversations to analyze and one or more tasks to execute.
|
|
32
|
+
* @param options The options parameters.
|
|
33
|
+
*/
|
|
34
|
+
beginConversationAnalysisAndWait(task: AnalyzeConversationJobsInput, options?: ConversationAnalysisOptionalParams): Promise<ConversationAnalysisResponse>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=conversationAnalysisClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversationAnalysisClient.d.ts","sourceRoot":"","sources":["../../../src/generated/conversationAnalysisClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAOjD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAa,MAAM,iBAAiB,CAAC;AAI5E,OAAO,EACL,wCAAwC,EACxC,4BAA4B,EAC5B,iCAAiC,EACjC,2BAA2B,EAC3B,4BAA4B,EAC5B,kCAAkC,EAClC,4BAA4B,EAC7B,MAAM,mBAAmB,CAAC;AAE3B,gBAAgB;AAChB,qBAAa,0BAA2B,SAAQ,UAAU,CAAC,aAAa;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBAED,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,wCAAwC;IA4DpD,8GAA8G;IAC9G,OAAO,CAAC,yBAAyB;IA2BjC;;;;OAIG;IACH,mBAAmB,CACjB,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,iCAAiC,GAC1C,OAAO,CAAC,2BAA2B,CAAC;IAOvC;;;;OAIG;IACG,yBAAyB,CAC7B,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,kCAAkC,GAC3C,OAAO,CACR,UAAU,CACR,kBAAkB,CAAC,4BAA4B,CAAC,EAChD,4BAA4B,CAC7B,CACF;IAqDD;;;;OAIG;IACG,gCAAgC,CACpC,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,kCAAkC,GAC3C,OAAO,CAAC,4BAA4B,CAAC;CAIzC"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) Microsoft Corporation.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*
|
|
6
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
7
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ConversationAnalysisClient = void 0;
|
|
11
|
+
const tslib_1 = require("tslib");
|
|
12
|
+
const coreClient = tslib_1.__importStar(require("@azure/core-client"));
|
|
13
|
+
const coreRestPipeline = tslib_1.__importStar(require("@azure/core-rest-pipeline"));
|
|
14
|
+
const core_lro_1 = require("@azure/core-lro");
|
|
15
|
+
const lroImpl_js_1 = require("./lroImpl.js");
|
|
16
|
+
const Parameters = tslib_1.__importStar(require("./models/parameters.js"));
|
|
17
|
+
const Mappers = tslib_1.__importStar(require("./models/mappers.js"));
|
|
18
|
+
/** @internal */
|
|
19
|
+
class ConversationAnalysisClient extends coreClient.ServiceClient {
|
|
20
|
+
endpoint;
|
|
21
|
+
apiVersion;
|
|
22
|
+
/**
|
|
23
|
+
* Initializes a new instance of the ConversationAnalysisClient class.
|
|
24
|
+
* @param endpoint Supported Cognitive Services endpoint (e.g.,
|
|
25
|
+
* https://<resource-name>.api.cognitiveservices.azure.com).
|
|
26
|
+
* @param options The parameter options
|
|
27
|
+
*/
|
|
28
|
+
constructor(endpoint, options) {
|
|
29
|
+
if (endpoint === undefined) {
|
|
30
|
+
throw new Error("'endpoint' cannot be null");
|
|
31
|
+
}
|
|
32
|
+
// Initializing default values for options
|
|
33
|
+
if (!options) {
|
|
34
|
+
options = {};
|
|
35
|
+
}
|
|
36
|
+
const defaults = {
|
|
37
|
+
requestContentType: "application/json; charset=utf-8"
|
|
38
|
+
};
|
|
39
|
+
const packageDetails = `azsdk-js-ai-language-conversations/1.0.0-beta.2`;
|
|
40
|
+
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
41
|
+
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
42
|
+
: `${packageDetails}`;
|
|
43
|
+
const optionsWithDefaults = {
|
|
44
|
+
...defaults,
|
|
45
|
+
...options,
|
|
46
|
+
userAgentOptions: {
|
|
47
|
+
userAgentPrefix
|
|
48
|
+
},
|
|
49
|
+
baseUri: options.endpoint ?? options.baseUri ?? "{Endpoint}/language"
|
|
50
|
+
};
|
|
51
|
+
super(optionsWithDefaults);
|
|
52
|
+
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
53
|
+
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
54
|
+
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
|
55
|
+
coreRestPipeline.bearerTokenAuthenticationPolicyName);
|
|
56
|
+
if (!bearerTokenAuthenticationPolicyFound) {
|
|
57
|
+
this.pipeline.removePolicy({
|
|
58
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
59
|
+
});
|
|
60
|
+
this.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
61
|
+
scopes: `${optionsWithDefaults.baseUri}/.default`,
|
|
62
|
+
challengeCallbacks: {
|
|
63
|
+
authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge
|
|
64
|
+
}
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Parameter assignments
|
|
69
|
+
this.endpoint = endpoint;
|
|
70
|
+
// Assigning values to Constant parameters
|
|
71
|
+
this.apiVersion = options.apiVersion || "2022-05-15-preview";
|
|
72
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
73
|
+
}
|
|
74
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
75
|
+
addCustomApiVersionPolicy(apiVersion) {
|
|
76
|
+
if (!apiVersion) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const apiVersionPolicy = {
|
|
80
|
+
name: "CustomApiVersionPolicy",
|
|
81
|
+
async sendRequest(request, next) {
|
|
82
|
+
const param = request.url.split("?");
|
|
83
|
+
if (param.length > 1) {
|
|
84
|
+
const newParams = param[1].split("&").map((item) => {
|
|
85
|
+
if (item.indexOf("api-version") > -1) {
|
|
86
|
+
return "api-version=" + apiVersion;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
return item;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
93
|
+
}
|
|
94
|
+
return next(request);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Analyzes the input conversation utterance.
|
|
101
|
+
* @param task A single conversational task to execute.
|
|
102
|
+
* @param options The options parameters.
|
|
103
|
+
*/
|
|
104
|
+
analyzeConversation(task, options) {
|
|
105
|
+
return this.sendOperationRequest({ task, options }, analyzeConversationOperationSpec);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.
|
|
109
|
+
* @param task The collection of conversations to analyze and one or more tasks to execute.
|
|
110
|
+
* @param options The options parameters.
|
|
111
|
+
*/
|
|
112
|
+
async beginConversationAnalysis(task, options) {
|
|
113
|
+
const directSendOperation = async (args, spec) => {
|
|
114
|
+
return this.sendOperationRequest(args, spec);
|
|
115
|
+
};
|
|
116
|
+
const sendOperation = async (args, spec) => {
|
|
117
|
+
let currentRawResponse = undefined;
|
|
118
|
+
const providedCallback = args.options?.onResponse;
|
|
119
|
+
const callback = (rawResponse, flatResponse) => {
|
|
120
|
+
currentRawResponse = rawResponse;
|
|
121
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
122
|
+
};
|
|
123
|
+
const updatedArgs = {
|
|
124
|
+
...args,
|
|
125
|
+
options: {
|
|
126
|
+
...args.options,
|
|
127
|
+
onResponse: callback
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
131
|
+
return {
|
|
132
|
+
flatResponse,
|
|
133
|
+
rawResponse: {
|
|
134
|
+
statusCode: currentRawResponse.status,
|
|
135
|
+
body: currentRawResponse.parsedBody,
|
|
136
|
+
headers: currentRawResponse.headers.toJSON()
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
const lro = new lroImpl_js_1.LroImpl(sendOperation, { task, options }, conversationAnalysisOperationSpec);
|
|
141
|
+
const poller = new core_lro_1.LroEngine(lro, {
|
|
142
|
+
resumeFrom: options?.resumeFrom,
|
|
143
|
+
intervalInMs: options?.updateIntervalInMs
|
|
144
|
+
});
|
|
145
|
+
await poller.poll();
|
|
146
|
+
return poller;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.
|
|
150
|
+
* @param task The collection of conversations to analyze and one or more tasks to execute.
|
|
151
|
+
* @param options The options parameters.
|
|
152
|
+
*/
|
|
153
|
+
async beginConversationAnalysisAndWait(task, options) {
|
|
154
|
+
const poller = await this.beginConversationAnalysis(task, options);
|
|
155
|
+
return poller.pollUntilDone();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
exports.ConversationAnalysisClient = ConversationAnalysisClient;
|
|
159
|
+
// Operation Specifications
|
|
160
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
161
|
+
const analyzeConversationOperationSpec = {
|
|
162
|
+
path: "/:analyze-conversations",
|
|
163
|
+
httpMethod: "POST",
|
|
164
|
+
responses: {
|
|
165
|
+
200: {
|
|
166
|
+
bodyMapper: Mappers.AnalyzeConversationTaskResult
|
|
167
|
+
},
|
|
168
|
+
default: {
|
|
169
|
+
bodyMapper: Mappers.ErrorResponse,
|
|
170
|
+
headersMapper: Mappers.ConversationAnalysisClientAnalyzeConversationExceptionHeaders
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
requestBody: Parameters.task,
|
|
174
|
+
queryParameters: [Parameters.apiVersion],
|
|
175
|
+
urlParameters: [Parameters.endpoint],
|
|
176
|
+
headerParameters: [Parameters.contentType, Parameters.accept],
|
|
177
|
+
mediaType: "json",
|
|
178
|
+
serializer
|
|
179
|
+
};
|
|
180
|
+
const conversationAnalysisOperationSpec = {
|
|
181
|
+
path: "/analyze-conversations/jobs",
|
|
182
|
+
httpMethod: "POST",
|
|
183
|
+
responses: {
|
|
184
|
+
200: {
|
|
185
|
+
bodyMapper: Mappers.AnalyzeConversationJobState
|
|
186
|
+
},
|
|
187
|
+
201: {
|
|
188
|
+
bodyMapper: Mappers.AnalyzeConversationJobState
|
|
189
|
+
},
|
|
190
|
+
202: {
|
|
191
|
+
bodyMapper: Mappers.AnalyzeConversationJobState
|
|
192
|
+
},
|
|
193
|
+
204: {
|
|
194
|
+
bodyMapper: Mappers.AnalyzeConversationJobState
|
|
195
|
+
},
|
|
196
|
+
default: {
|
|
197
|
+
bodyMapper: Mappers.ErrorResponse
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
requestBody: Parameters.task1,
|
|
201
|
+
queryParameters: [Parameters.apiVersion],
|
|
202
|
+
urlParameters: [Parameters.endpoint],
|
|
203
|
+
headerParameters: [Parameters.contentType, Parameters.accept],
|
|
204
|
+
mediaType: "json",
|
|
205
|
+
serializer
|
|
206
|
+
};
|
|
207
|
+
//# sourceMappingURL=conversationAnalysisClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversationAnalysisClient.js","sourceRoot":"","sources":["../../../src/generated/conversationAnalysisClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,uEAAiD;AACjD,oFAA8D;AAM9D,8CAA4E;AAC5E,6CAAuC;AACvC,2EAAqD;AACrD,qEAA+C;AAW/C,gBAAgB;AAChB,MAAa,0BAA2B,SAAQ,UAAU,CAAC,aAAa;IACtE,QAAQ,CAAS;IACjB,UAAU,CAAS;IAEnB;;;;;OAKG;IACH,YACE,QAAgB,EAChB,OAAkD;QAElD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAA6C;YACzD,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,iDAAiD,CAAC;QACzE,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,GAAG;YAC1B,GAAG,QAAQ;YACX,GAAG,OAAO;YACV,gBAAgB,EA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,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 { PollerLike, PollOperationState, LroEngine } from \"@azure/core-lro\";\nimport { LroImpl } from \"./lroImpl.js\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n ConversationAnalysisClientOptionalParams,\n AnalyzeConversationTaskUnion,\n AnalyzeConversationOptionalParams,\n AnalyzeConversationResponse,\n AnalyzeConversationJobsInput,\n ConversationAnalysisOptionalParams,\n ConversationAnalysisResponse\n} from \"./models/index.js\";\n\n/** @internal */\nexport class ConversationAnalysisClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the ConversationAnalysisClient 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(\n endpoint: string,\n options?: ConversationAnalysisClientOptionalParams\n ) {\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: ConversationAnalysisClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-ai-language-conversations/1.0.0-beta.2`;\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-05-15-preview\";\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 \"api-version=\" + 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 * Analyzes the input conversation utterance.\n * @param task A single conversational task to execute.\n * @param options The options parameters.\n */\n analyzeConversation(\n task: AnalyzeConversationTaskUnion,\n options?: AnalyzeConversationOptionalParams\n ): Promise<AnalyzeConversationResponse> {\n return this.sendOperationRequest(\n { task, options },\n analyzeConversationOperationSpec\n );\n }\n\n /**\n * Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.\n * @param task The collection of conversations to analyze and one or more tasks to execute.\n * @param options The options parameters.\n */\n async beginConversationAnalysis(\n task: AnalyzeConversationJobsInput,\n options?: ConversationAnalysisOptionalParams\n ): Promise<\n PollerLike<\n PollOperationState<ConversationAnalysisResponse>,\n ConversationAnalysisResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<ConversationAnalysisResponse> => {\n return this.sendOperationRequest(args, spec);\n };\n const sendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = new LroImpl(\n sendOperation,\n { task, options },\n conversationAnalysisOperationSpec\n );\n const poller = new LroEngine(lro, {\n resumeFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.\n * @param task The collection of conversations to analyze and one or more tasks to execute.\n * @param options The options parameters.\n */\n async beginConversationAnalysisAndWait(\n task: AnalyzeConversationJobsInput,\n options?: ConversationAnalysisOptionalParams\n ): Promise<ConversationAnalysisResponse> {\n const poller = await this.beginConversationAnalysis(task, options);\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst analyzeConversationOperationSpec: coreClient.OperationSpec = {\n path: \"/:analyze-conversations\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeConversationTaskResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n headersMapper:\n Mappers.ConversationAnalysisClientAnalyzeConversationExceptionHeaders\n }\n },\n requestBody: Parameters.task,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst conversationAnalysisOperationSpec: coreClient.OperationSpec = {\n path: \"/analyze-conversations/jobs\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeConversationJobState\n },\n 201: {\n bodyMapper: Mappers.AnalyzeConversationJobState\n },\n 202: {\n bodyMapper: Mappers.AnalyzeConversationJobState\n },\n 204: {\n bodyMapper: Mappers.AnalyzeConversationJobState\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.task1,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAQA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) Microsoft Corporation.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*
|
|
6
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
7
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ConversationAnalysisClient = void 0;
|
|
11
|
+
const tslib_1 = require("tslib");
|
|
12
|
+
tslib_1.__exportStar(require("./models/index.js"), exports);
|
|
13
|
+
var conversationAnalysisClient_js_1 = require("./conversationAnalysisClient.js");
|
|
14
|
+
Object.defineProperty(exports, "ConversationAnalysisClient", { enumerable: true, get: function () { return conversationAnalysisClient_js_1.ConversationAnalysisClient; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,4DAAkC;AAClC,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA","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/index.js\";\nexport { ConversationAnalysisClient } from \"./conversationAnalysisClient.js\";\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LongRunningOperation, LroResponse } from "@azure/core-lro";
|
|
2
|
+
export declare class LroImpl<T> implements LongRunningOperation<T> {
|
|
3
|
+
private sendOperationFn;
|
|
4
|
+
private args;
|
|
5
|
+
private spec;
|
|
6
|
+
requestPath: string;
|
|
7
|
+
requestMethod: string;
|
|
8
|
+
constructor(sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>, args: Record<string, unknown>, spec: {
|
|
9
|
+
readonly requestBody?: unknown;
|
|
10
|
+
readonly path?: string;
|
|
11
|
+
readonly httpMethod: string;
|
|
12
|
+
} & Record<string, any>, requestPath?: string, requestMethod?: string);
|
|
13
|
+
sendInitialRequest(): Promise<LroResponse<T>>;
|
|
14
|
+
sendPollRequest(path: string): Promise<LroResponse<T>>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=lroImpl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lroImpl.d.ts","sourceRoot":"","sources":["../../../src/generated/lroImpl.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEpE,qBAAa,OAAO,CAAC,CAAC,CAAE,YAAW,oBAAoB,CAAC,CAAC,CAAC;IAEtD,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,IAAI;IAKL,WAAW,EAAE,MAAM;IACnB,aAAa,EAAE,MAAM;gBARpB,eAAe,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAClE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,IAAI,EAAE;QACZ,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;QAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;KAC7B,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAChB,WAAW,GAAE,MAAmB,EAChC,aAAa,GAAE,MAAwB;IAEnC,kBAAkB,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAG7C,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAQpE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) Microsoft Corporation.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*
|
|
6
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
7
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.LroImpl = void 0;
|
|
11
|
+
class LroImpl {
|
|
12
|
+
sendOperationFn;
|
|
13
|
+
args;
|
|
14
|
+
spec;
|
|
15
|
+
requestPath;
|
|
16
|
+
requestMethod;
|
|
17
|
+
constructor(sendOperationFn, args, spec, requestPath = spec.path, requestMethod = spec.httpMethod) {
|
|
18
|
+
this.sendOperationFn = sendOperationFn;
|
|
19
|
+
this.args = args;
|
|
20
|
+
this.spec = spec;
|
|
21
|
+
this.requestPath = requestPath;
|
|
22
|
+
this.requestMethod = requestMethod;
|
|
23
|
+
}
|
|
24
|
+
async sendInitialRequest() {
|
|
25
|
+
return this.sendOperationFn(this.args, this.spec);
|
|
26
|
+
}
|
|
27
|
+
async sendPollRequest(path) {
|
|
28
|
+
const { requestBody, ...restSpec } = this.spec;
|
|
29
|
+
return this.sendOperationFn(this.args, {
|
|
30
|
+
...restSpec,
|
|
31
|
+
path,
|
|
32
|
+
httpMethod: "GET"
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.LroImpl = LroImpl;
|
|
37
|
+
//# sourceMappingURL=lroImpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lroImpl.js","sourceRoot":"","sources":["../../../src/generated/lroImpl.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAIH,MAAa,OAAO;IAER;IACA;IACA;IAKD;IACA;IATT,YACU,eAAkE,EAClE,IAA6B,EAC7B,IAIe,EAChB,cAAsB,IAAI,CAAC,IAAK,EAChC,gBAAwB,IAAI,CAAC,UAAU;QARtC,oBAAe,GAAf,eAAe,CAAmD;QAClE,SAAI,GAAJ,IAAI,CAAyB;QAC7B,SAAI,GAAJ,IAAI,CAIW;QAChB,gBAAW,GAAX,WAAW,CAAqB;QAChC,kBAAa,GAAb,aAAa,CAA0B;IAC7C,CAAC;IACG,KAAK,CAAC,kBAAkB;QAC7B,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IACM,KAAK,CAAC,eAAe,CAAC,IAAY;QACvC,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC/C,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE;YACrC,GAAG,QAAQ;YACX,IAAI;YACJ,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;CACF;AAvBD,0BAuBC","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 { LongRunningOperation, LroResponse } from \"@azure/core-lro\";\n\nexport class LroImpl<T> implements LongRunningOperation<T> {\n constructor(\n private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,\n private args: Record<string, unknown>,\n private spec: {\n readonly requestBody?: unknown;\n readonly path?: string;\n readonly httpMethod: string;\n } & Record<string, any>,\n public requestPath: string = spec.path!,\n public requestMethod: string = spec.httpMethod\n ) {}\n public async sendInitialRequest(): Promise<LroResponse<T>> {\n return this.sendOperationFn(this.args, this.spec);\n }\n public async sendPollRequest(path: string): Promise<LroResponse<T>> {\n const { requestBody, ...restSpec } = this.spec;\n return this.sendOperationFn(this.args, {\n ...restSpec,\n path,\n httpMethod: \"GET\"\n });\n }\n}\n"]}
|