microsoft-cognitiveservices-speech-sdk
Version:
Microsoft Cognitive Services Speech SDK for JavaScript
1 lines • 4.18 kB
Source Map (JSON)
{"version":3,"sources":["src/common.browser/RestConfigBase.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,OAAO,CAAC,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,CAAC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,cAAc;IAEvB,WAAkB,cAAc,IAAI,eAAe,CAElD;IAED,WAAkB,YAAY,IAAI,WAAW,CAE5C;IAED,WAAkB,UAAU,IAAI,cAAc,CAE7C;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,yBAAyB,CAM/C;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAWpC;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAevC;CAEL","file":"RestConfigBase.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license.\r\n\r\nimport { IErrorMessages } from \"../common/Exports.js\";\r\n/**\r\n * HTTP request helper\r\n */\r\nexport interface IRequestOptions {\r\n headers?: {[key: string]: string};\r\n ignoreCache?: boolean;\r\n timeout?: number;\r\n}\r\n\r\nexport interface IRestParams {\r\n apiVersion: string;\r\n authorization: string;\r\n clientAppId: string;\r\n contentTypeKey: string;\r\n correlationId: string;\r\n languageCode: string;\r\n nickname: string;\r\n profanity: string;\r\n requestId: string;\r\n roomId: string;\r\n sessionToken: string;\r\n subscriptionKey: string;\r\n subscriptionRegion: string;\r\n token: string;\r\n}\r\n\r\nexport class RestConfigBase {\r\n\r\n public static get requestOptions(): IRequestOptions {\r\n return RestConfigBase.privDefaultRequestOptions;\r\n }\r\n\r\n public static get configParams(): IRestParams {\r\n return RestConfigBase.privDefaultParams;\r\n }\r\n\r\n public static get restErrors(): IErrorMessages {\r\n return RestConfigBase.privRestErrors;\r\n }\r\n\r\n private static readonly privDefaultRequestOptions: IRequestOptions = {\r\n headers: {\r\n Accept: \"application/json\",\r\n },\r\n ignoreCache: false,\r\n timeout: 10000,\r\n };\r\n\r\n private static readonly privRestErrors: IErrorMessages = {\r\n authInvalidSubscriptionKey: \"You must specify either an authentication token to use, or a Cognitive Speech subscription key.\",\r\n authInvalidSubscriptionRegion: \"You must specify the Cognitive Speech region to use.\",\r\n invalidArgs: \"Required input not found: {arg}.\",\r\n invalidCreateJoinConversationResponse: \"Creating/Joining conversation failed with HTTP {status}.\",\r\n invalidParticipantRequest: \"The requested participant was not found.\",\r\n permissionDeniedConnect: \"Required credentials not found.\",\r\n permissionDeniedConversation: \"Invalid operation: only the host can {command} the conversation.\",\r\n permissionDeniedParticipant: \"Invalid operation: only the host can {command} a participant.\",\r\n permissionDeniedSend: \"Invalid operation: the conversation is not in a connected state.\",\r\n permissionDeniedStart: \"Invalid operation: there is already an active conversation.\",\r\n };\r\n\r\n private static readonly privDefaultParams: IRestParams = {\r\n apiVersion: \"api-version\",\r\n authorization: \"Authorization\",\r\n clientAppId: \"X-ClientAppId\",\r\n contentTypeKey: \"Content-Type\",\r\n correlationId: \"X-CorrelationId\",\r\n languageCode: \"language\",\r\n nickname: \"nickname\",\r\n profanity: \"profanity\",\r\n requestId: \"X-RequestId\",\r\n roomId: \"roomid\",\r\n sessionToken: \"token\",\r\n subscriptionKey: \"Ocp-Apim-Subscription-Key\",\r\n subscriptionRegion: \"Ocp-Apim-Subscription-Region\",\r\n token: \"X-CapitoToken\",\r\n };\r\n\r\n}\r\n"]}