UNPKG

@voice-ping/cognitive-services-speech

Version:

VoicePing Cognitive Services Speech SDK for JavaScript forked from Microsoft

1 lines 4.01 kB
{"version":3,"sources":["src/common.browser/RestConfigBase.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD;;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.\n// Licensed under the MIT license.\n\nimport { IErrorMessages } from \"../common/Exports\";\n/**\n * HTTP request helper\n */\nexport interface IRequestOptions {\n headers?: {[key: string]: string};\n ignoreCache?: boolean;\n timeout?: number;\n}\n\nexport interface IRestParams {\n apiVersion: string;\n authorization: string;\n clientAppId: string;\n contentTypeKey: string;\n correlationId: string;\n languageCode: string;\n nickname: string;\n profanity: string;\n requestId: string;\n roomId: string;\n sessionToken: string;\n subscriptionKey: string;\n subscriptionRegion: string;\n token: string;\n}\n\nexport class RestConfigBase {\n\n public static get requestOptions(): IRequestOptions {\n return RestConfigBase.privDefaultRequestOptions;\n }\n\n public static get configParams(): IRestParams {\n return RestConfigBase.privDefaultParams;\n }\n\n public static get restErrors(): IErrorMessages {\n return RestConfigBase.privRestErrors;\n }\n\n private static readonly privDefaultRequestOptions: IRequestOptions = {\n headers: {\n Accept: \"application/json\",\n },\n ignoreCache: false,\n timeout: 10000,\n };\n\n private static readonly privRestErrors: IErrorMessages = {\n authInvalidSubscriptionKey: \"You must specify either an authentication token to use, or a Cognitive Speech subscription key.\",\n authInvalidSubscriptionRegion: \"You must specify the Cognitive Speech region to use.\",\n invalidArgs: \"Required input not found: {arg}.\",\n invalidCreateJoinConversationResponse: \"Creating/Joining conversation failed with HTTP {status}.\",\n invalidParticipantRequest: \"The requested participant was not found.\",\n permissionDeniedConnect: \"Required credentials not found.\",\n permissionDeniedConversation: \"Invalid operation: only the host can {command} the conversation.\",\n permissionDeniedParticipant: \"Invalid operation: only the host can {command} a participant.\",\n permissionDeniedSend: \"Invalid operation: the conversation is not in a connected state.\",\n permissionDeniedStart: \"Invalid operation: there is already an active conversation.\",\n };\n\n private static readonly privDefaultParams: IRestParams = {\n apiVersion: \"api-version\",\n authorization: \"Authorization\",\n clientAppId: \"X-ClientAppId\",\n contentTypeKey: \"Content-Type\",\n correlationId: \"X-CorrelationId\",\n languageCode: \"language\",\n nickname: \"nickname\",\n profanity: \"profanity\",\n requestId: \"X-RequestId\",\n roomId: \"roomid\",\n sessionToken: \"token\",\n subscriptionKey: \"Ocp-Apim-Subscription-Key\",\n subscriptionRegion: \"Ocp-Apim-Subscription-Region\",\n token: \"X-CapitoToken\",\n };\n\n}\n"]}