{"version":3,"sources":["src/common.speech/CognitiveSubscriptionKeyAuthentication.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,QAAQ,EACR,eAAe,EAClB,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,qBAAa,sCAAuC,YAAW,eAAe;IAC1E,OAAO,CAAC,YAAY,CAAW;IAE/B;;;;OAIG;gBACS,eAAe,EAAE,MAAM;IAQnC;;;;;;OAMG;IACI,KAAK,qBAAsB,MAAM,KAAG,OAAO,CAAC,QAAQ,CAAC,CAE3D;IAED;;;;;;OAMG;IACI,aAAa,qBAAsB,MAAM,KAAG,OAAO,CAAC,QAAQ,CAAC,CAEnE;CACJ","file":"CognitiveSubscriptionKeyAuthentication.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license.\r\n\r\nimport {\r\n    ArgumentNullError,\r\n} from \"../common/Exports\";\r\nimport { HeaderNames } from \"./HeaderNames\";\r\nimport {\r\n    AuthInfo,\r\n    IAuthentication\r\n} from \"./IAuthentication\";\r\n\r\n/**\r\n * @class\r\n */\r\nexport class CognitiveSubscriptionKeyAuthentication implements IAuthentication {\r\n    private privAuthInfo: AuthInfo;\r\n\r\n    /**\r\n     * Creates and initializes an instance of the CognitiveSubscriptionKeyAuthentication class.\r\n     * @constructor\r\n     * @param {string} subscriptionKey - The subscription key\r\n     */\r\n    constructor(subscriptionKey: string) {\r\n        if (!subscriptionKey) {\r\n            throw new ArgumentNullError(\"subscriptionKey\");\r\n        }\r\n\r\n        this.privAuthInfo = new AuthInfo(HeaderNames.AuthKey, subscriptionKey);\r\n    }\r\n\r\n    /**\r\n     * Fetches the subscription key.\r\n     * @member\r\n     * @function\r\n     * @public\r\n     * @param {string} authFetchEventId - The id to fetch.\r\n     */\r\n    public fetch = (authFetchEventId: string): Promise<AuthInfo> => {\r\n        return Promise.resolve(this.privAuthInfo);\r\n    }\r\n\r\n    /**\r\n     * Fetches the subscription key.\r\n     * @member\r\n     * @function\r\n     * @public\r\n     * @param {string} authFetchEventId - The id to fetch.\r\n     */\r\n    public fetchOnExpiry = (authFetchEventId: string): Promise<AuthInfo> => {\r\n        return Promise.resolve(this.privAuthInfo);\r\n    }\r\n}\r\n"]}