5802cbe6aa0cce462fff87789a68d3ca231bfac7095c7fc70416edf72af0d79b.json 6.5 KB

1
  1. {"ast":null,"code":"\"use strict\";\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nvar _asyncToGenerator = require(\"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/asyncToGenerator.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ConversationRequestSession = void 0;\nconst Exports_js_1 = require(\"../../common/Exports.js\");\n/**\n * Placeholder class for the Conversation Request Session. Based off RequestSession.\n * TODO: define what telemetry is required.\n */\nclass ConversationRequestSession {\n constructor(sessionId) {\n this.privIsDisposed = false;\n this.privDetachables = new Array();\n this.privSessionId = sessionId;\n this.privRequestId = Exports_js_1.createNoDashGuid();\n this.privRequestCompletionDeferral = new Exports_js_1.Deferred();\n }\n get sessionId() {\n return this.privSessionId;\n }\n get requestId() {\n return this.privRequestId;\n }\n get completionPromise() {\n return this.privRequestCompletionDeferral.promise;\n }\n onPreConnectionStart(authFetchEventId, connectionId) {\n this.privSessionId = connectionId;\n }\n onAuthCompleted(isError) {\n if (isError) {\n this.onComplete();\n }\n }\n onConnectionEstablishCompleted(statusCode) {\n if (statusCode === 200) {\n return;\n } else if (statusCode === 403) {\n this.onComplete();\n }\n }\n onServiceTurnEndResponse(continuousRecognition) {\n if (!continuousRecognition) {\n this.onComplete();\n } else {\n this.privRequestId = Exports_js_1.createNoDashGuid();\n }\n }\n dispose() {\n var _this = this;\n return _asyncToGenerator(function* () {\n if (!_this.privIsDisposed) {\n // we should have completed by now. If we did not its an unknown error.\n _this.privIsDisposed = true;\n for (const detachable of _this.privDetachables) {\n yield detachable.detach();\n }\n }\n })();\n }\n onComplete() {\n //\n }\n}\nexports.ConversationRequestSession = ConversationRequestSession;","map":{"version":3,"names":["_asyncToGenerator","require","default","Object","defineProperty","exports","value","ConversationRequestSession","Exports_js_1","constructor","sessionId","privIsDisposed","privDetachables","Array","privSessionId","privRequestId","createNoDashGuid","privRequestCompletionDeferral","Deferred","requestId","completionPromise","promise","onPreConnectionStart","authFetchEventId","connectionId","onAuthCompleted","isError","onComplete","onConnectionEstablishCompleted","statusCode","onServiceTurnEndResponse","continuousRecognition","dispose","_this","detachable","detach"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common.speech/Transcription/ConversationRequestSession.js"],"sourcesContent":["\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConversationRequestSession = void 0;\nconst Exports_js_1 = require(\"../../common/Exports.js\");\n/**\n * Placeholder class for the Conversation Request Session. Based off RequestSession.\n * TODO: define what telemetry is required.\n */\nclass ConversationRequestSession {\n constructor(sessionId) {\n this.privIsDisposed = false;\n this.privDetachables = new Array();\n this.privSessionId = sessionId;\n this.privRequestId = Exports_js_1.createNoDashGuid();\n this.privRequestCompletionDeferral = new Exports_js_1.Deferred();\n }\n get sessionId() {\n return this.privSessionId;\n }\n get requestId() {\n return this.privRequestId;\n }\n get completionPromise() {\n return this.privRequestCompletionDeferral.promise;\n }\n onPreConnectionStart(authFetchEventId, connectionId) {\n this.privSessionId = connectionId;\n }\n onAuthCompleted(isError) {\n if (isError) {\n this.onComplete();\n }\n }\n onConnectionEstablishCompleted(statusCode) {\n if (statusCode === 200) {\n return;\n }\n else if (statusCode === 403) {\n this.onComplete();\n }\n }\n onServiceTurnEndResponse(continuousRecognition) {\n if (!continuousRecognition) {\n this.onComplete();\n }\n else {\n this.privRequestId = Exports_js_1.createNoDashGuid();\n }\n }\n async dispose() {\n if (!this.privIsDisposed) {\n // we should have completed by now. If we did not its an unknown error.\n this.privIsDisposed = true;\n for (const detachable of this.privDetachables) {\n await detachable.detach();\n }\n }\n }\n onComplete() {\n //\n }\n}\nexports.ConversationRequestSession = ConversationRequestSession;\n\n"],"mappings":"AAAA,YAAY;;AACZ;AAC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