1 |
- {"ast":null,"code":"\"use strict\";\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CustomCommandsConfig = void 0;\nconst Contracts_js_1 = require(\"./Contracts.js\");\nconst DialogServiceConfig_js_1 = require(\"./DialogServiceConfig.js\");\nconst Exports_js_1 = require(\"./Exports.js\");\n/**\n * Class that defines configurations for the dialog service connector object for using a CustomCommands backend.\n * @class CustomCommandsConfig\n */\nclass CustomCommandsConfig extends DialogServiceConfig_js_1.DialogServiceConfigImpl {\n /**\n * Creates an instance of CustomCommandsConfig.\n */\n constructor() {\n super();\n }\n /**\n * Creates an instance of the bot framework config with the specified subscription and region.\n * @member CustomCommandsConfig.fromSubscription\n * @function\n * @public\n * @param applicationId Speech Commands application id.\n * @param subscription Subscription key associated with the bot\n * @param region The region name (see the <a href=\"https://aka.ms/csspeech/region\">region page</a>).\n * @returns {CustomCommandsConfig} A new bot framework config.\n */\n static fromSubscription(applicationId, subscription, region) {\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(applicationId, \"applicationId\");\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(subscription, \"subscription\");\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(region, \"region\");\n const customCommandsConfig = new DialogServiceConfig_js_1.DialogServiceConfigImpl();\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.Conversation_DialogType, DialogServiceConfig_js_1.DialogServiceConfig.DialogTypes.CustomCommands);\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.Conversation_ApplicationId, applicationId);\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.SpeechServiceConnection_Key, subscription);\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.SpeechServiceConnection_Region, region);\n return customCommandsConfig;\n }\n /**\n * Creates an instance of the bot framework config with the specified Speech Commands application id, authorization token and region.\n * Note: The caller needs to ensure that the authorization token is valid. Before the authorization token\n * expires, the caller needs to refresh it by calling this setter with a new valid token.\n * As configuration values are copied when creating a new recognizer, the new token value will not apply to recognizers that have already been created.\n * For recognizers that have been created before, you need to set authorization token of the corresponding recognizer\n * to refresh the token. Otherwise, the recognizers will encounter errors during recognition.\n * @member CustomCommandsConfig.fromAuthorizationToken\n * @function\n * @public\n * @param applicationId Speech Commands application id.\n * @param authorizationToken The authorization token associated with the application.\n * @param region The region name (see the <a href=\"https://aka.ms/csspeech/region\">region page</a>).\n * @returns {CustomCommandsConfig} A new speech commands config.\n */\n static fromAuthorizationToken(applicationId, authorizationToken, region) {\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(applicationId, \"applicationId\");\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(authorizationToken, \"authorizationToken\");\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(region, \"region\");\n const customCommandsConfig = new DialogServiceConfig_js_1.DialogServiceConfigImpl();\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.Conversation_DialogType, DialogServiceConfig_js_1.DialogServiceConfig.DialogTypes.CustomCommands);\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.Conversation_ApplicationId, applicationId);\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.SpeechServiceAuthorization_Token, authorizationToken);\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.SpeechServiceConnection_Region, region);\n return customCommandsConfig;\n }\n /**\n * Sets the corresponding backend application identifier.\n * @member CustomCommandsConfig.prototype.Conversation_ApplicationId\n * @function\n * @public\n * @param {string} value - The application identifier to set.\n */\n set applicationId(value) {\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(value, \"value\");\n this.setProperty(Exports_js_1.PropertyId.Conversation_ApplicationId, value);\n }\n /**\n * Gets the corresponding backend application identifier.\n * @member CustomCommandsConfig.prototype.Conversation_ApplicationId\n * @function\n * @public\n * @param {string} value - The application identifier to get.\n */\n get applicationId() {\n return this.getProperty(Exports_js_1.PropertyId.Conversation_ApplicationId);\n }\n}\nexports.CustomCommandsConfig = CustomCommandsConfig;","map":{"version":3,"names":["Object","defineProperty","exports","value","CustomCommandsConfig","Contracts_js_1","require","DialogServiceConfig_js_1","Exports_js_1","DialogServiceConfigImpl","constructor","fromSubscription","applicationId","subscription","region","Contracts","throwIfNullOrWhitespace","customCommandsConfig","setProperty","PropertyId","Conversation_DialogType","DialogServiceConfig","DialogTypes","CustomCommands","Conversation_ApplicationId","SpeechServiceConnection_Key","SpeechServiceConnection_Region","fromAuthorizationToken","authorizationToken","SpeechServiceAuthorization_Token","getProperty"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/CustomCommandsConfig.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.CustomCommandsConfig = void 0;\nconst Contracts_js_1 = require(\"./Contracts.js\");\nconst DialogServiceConfig_js_1 = require(\"./DialogServiceConfig.js\");\nconst Exports_js_1 = require(\"./Exports.js\");\n/**\n * Class that defines configurations for the dialog service connector object for using a CustomCommands backend.\n * @class CustomCommandsConfig\n */\nclass CustomCommandsConfig extends DialogServiceConfig_js_1.DialogServiceConfigImpl {\n /**\n * Creates an instance of CustomCommandsConfig.\n */\n constructor() {\n super();\n }\n /**\n * Creates an instance of the bot framework config with the specified subscription and region.\n * @member CustomCommandsConfig.fromSubscription\n * @function\n * @public\n * @param applicationId Speech Commands application id.\n * @param subscription Subscription key associated with the bot\n * @param region The region name (see the <a href=\"https://aka.ms/csspeech/region\">region page</a>).\n * @returns {CustomCommandsConfig} A new bot framework config.\n */\n static fromSubscription(applicationId, subscription, region) {\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(applicationId, \"applicationId\");\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(subscription, \"subscription\");\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(region, \"region\");\n const customCommandsConfig = new DialogServiceConfig_js_1.DialogServiceConfigImpl();\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.Conversation_DialogType, DialogServiceConfig_js_1.DialogServiceConfig.DialogTypes.CustomCommands);\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.Conversation_ApplicationId, applicationId);\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.SpeechServiceConnection_Key, subscription);\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.SpeechServiceConnection_Region, region);\n return customCommandsConfig;\n }\n /**\n * Creates an instance of the bot framework config with the specified Speech Commands application id, authorization token and region.\n * Note: The caller needs to ensure that the authorization token is valid. Before the authorization token\n * expires, the caller needs to refresh it by calling this setter with a new valid token.\n * As configuration values are copied when creating a new recognizer, the new token value will not apply to recognizers that have already been created.\n * For recognizers that have been created before, you need to set authorization token of the corresponding recognizer\n * to refresh the token. Otherwise, the recognizers will encounter errors during recognition.\n * @member CustomCommandsConfig.fromAuthorizationToken\n * @function\n * @public\n * @param applicationId Speech Commands application id.\n * @param authorizationToken The authorization token associated with the application.\n * @param region The region name (see the <a href=\"https://aka.ms/csspeech/region\">region page</a>).\n * @returns {CustomCommandsConfig} A new speech commands config.\n */\n static fromAuthorizationToken(applicationId, authorizationToken, region) {\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(applicationId, \"applicationId\");\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(authorizationToken, \"authorizationToken\");\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(region, \"region\");\n const customCommandsConfig = new DialogServiceConfig_js_1.DialogServiceConfigImpl();\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.Conversation_DialogType, DialogServiceConfig_js_1.DialogServiceConfig.DialogTypes.CustomCommands);\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.Conversation_ApplicationId, applicationId);\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.SpeechServiceAuthorization_Token, authorizationToken);\n customCommandsConfig.setProperty(Exports_js_1.PropertyId.SpeechServiceConnection_Region, region);\n return customCommandsConfig;\n }\n /**\n * Sets the corresponding backend application identifier.\n * @member CustomCommandsConfig.prototype.Conversation_ApplicationId\n * @function\n * @public\n * @param {string} value - The application identifier to set.\n */\n set applicationId(value) {\n Contracts_js_1.Contracts.throwIfNullOrWhitespace(value, \"value\");\n this.setProperty(Exports_js_1.PropertyId.Conversation_ApplicationId, value);\n }\n /**\n * Gets the corresponding backend application identifier.\n * @member CustomCommandsConfig.prototype.Conversation_ApplicationId\n * @function\n * @public\n * @param {string} value - The application identifier to get.\n */\n get applicationId() {\n return this.getProperty(Exports_js_1.PropertyId.Conversation_ApplicationId);\n }\n}\nexports.CustomCommandsConfig = CustomCommandsConfig;\n\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACAA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAC7DD,OAAO,CAACE,oBAAoB,GAAG,KAAK,CAAC;AACrC,MAAMC,cAAc,GAAGC,OAAO,CAAC,gBAAgB,CAAC;AAChD,MAAMC,wBAAwB,GAAGD,OAAO,CAAC,0BAA0B,CAAC;AACpE,MAAME,YAAY,GAAGF,OAAO,CAAC,cAAc,CAAC;AAC5C;AACA;AACA;AACA;AACA,MAAMF,oBAAoB,SAASG,wBAAwB,CAACE,uBAAuB,CAAC;EAChF;AACJ;AACA;EACIC,WAAWA,CAAA,EAAG;IACV,KAAK,CAAC,CAAC;EACX;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACI,OAAOC,gBAAgBA,CAACC,aAAa,EAAEC,YAAY,EAAEC,MAAM,EAAE;IACzDT,cAAc,CAACU,SAAS,CAACC,uBAAuB,CAACJ,aAAa,EAAE,eAAe,CAAC;IAChFP,cAAc,CAACU,SAAS,CAACC,uBAAuB,CAACH,YAAY,EAAE,cAAc,CAAC;IAC9ER,cAAc,CAACU,SAAS,CAACC,uBAAuB,CAACF,MAAM,EAAE,QAAQ,CAAC;IAClE,MAAMG,oBAAoB,GAAG,IAA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ACW,UAAU,CAACO,8BAA8B,EAAEZ,MAAM,CAAC;IAChG,OAAOG,oBAAoB;EAC/B;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;EACI,IAAIL,aAAaA,CAACT,KAAK,EAAE;IACrBE,cAAc,CAACU,SAAS,CAACC,uBAAuB,CAACb,KAAK,EAAE,OAAO,CAAC;IAChE,IAAI,CAACe,WAAW,CAACV,YAAY,CAACW,UAAU,CAACK,0BAA0B,EAAErB,KAAK,CAAC;EAC/E;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;EACI,IAAIS,aAAaA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACkB,WAAW,CAACtB,YAAY,CAACW,UAAU,CAACK,0BAA0B,CAAC;EAC/E;AACJ;AACAtB,OAAO,CAACE,oBAAoB,GAAGA,oBAAoB","ignoreList":[]},"metadata":{},"sourceType":"script","externalDependencies":[]}
|