ab05a175697177d5bd99c45b751474bf71318d8ad72171b85a57c1197ad43306.json 4.9 KB

1
  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.CognitiveTokenAuthentication = void 0;\nconst Exports_js_1 = require(\"../common/Exports.js\");\nconst IAuthentication_js_1 = require(\"./IAuthentication.js\");\nconst HeaderNames_js_1 = require(\"./HeaderNames.js\");\nclass CognitiveTokenAuthentication {\n constructor(fetchCallback, fetchOnExpiryCallback) {\n if (!fetchCallback) {\n throw new Exports_js_1.ArgumentNullError(\"fetchCallback\");\n }\n if (!fetchOnExpiryCallback) {\n throw new Exports_js_1.ArgumentNullError(\"fetchOnExpiryCallback\");\n }\n this.privFetchCallback = fetchCallback;\n this.privFetchOnExpiryCallback = fetchOnExpiryCallback;\n }\n fetch(authFetchEventId) {\n return this.privFetchCallback(authFetchEventId).then(token => new IAuthentication_js_1.AuthInfo(HeaderNames_js_1.HeaderNames.Authorization, token === undefined ? undefined : CognitiveTokenAuthentication.privTokenPrefix + token));\n }\n fetchOnExpiry(authFetchEventId) {\n return this.privFetchOnExpiryCallback(authFetchEventId).then(token => new IAuthentication_js_1.AuthInfo(HeaderNames_js_1.HeaderNames.Authorization, token === undefined ? undefined : CognitiveTokenAuthentication.privTokenPrefix + token));\n }\n}\nexports.CognitiveTokenAuthentication = CognitiveTokenAuthentication;\nCognitiveTokenAuthentication.privTokenPrefix = \"Bearer \";","map":{"version":3,"names":["Object","defineProperty","exports","value","CognitiveTokenAuthentication","Exports_js_1","require","IAuthentication_js_1","HeaderNames_js_1","constructor","fetchCallback","fetchOnExpiryCallback","ArgumentNullError","privFetchCallback","privFetchOnExpiryCallback","fetch","authFetchEventId","then","token","AuthInfo","HeaderNames","Authorization","undefined","privTokenPrefix","fetchOnExpiry"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common.speech/CognitiveTokenAuthentication.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.CognitiveTokenAuthentication = void 0;\nconst Exports_js_1 = require(\"../common/Exports.js\");\nconst IAuthentication_js_1 = require(\"./IAuthentication.js\");\nconst HeaderNames_js_1 = require(\"./HeaderNames.js\");\nclass CognitiveTokenAuthentication {\n constructor(fetchCallback, fetchOnExpiryCallback) {\n if (!fetchCallback) {\n throw new Exports_js_1.ArgumentNullError(\"fetchCallback\");\n }\n if (!fetchOnExpiryCallback) {\n throw new Exports_js_1.ArgumentNullError(\"fetchOnExpiryCallback\");\n }\n this.privFetchCallback = fetchCallback;\n this.privFetchOnExpiryCallback = fetchOnExpiryCallback;\n }\n fetch(authFetchEventId) {\n return this.privFetchCallback(authFetchEventId).then((token) => new IAuthentication_js_1.AuthInfo(HeaderNames_js_1.HeaderNames.Authorization, token === undefined ? undefined : CognitiveTokenAuthentication.privTokenPrefix + token));\n }\n fetchOnExpiry(authFetchEventId) {\n return this.privFetchOnExpiryCallback(authFetchEventId).then((token) => new IAuthentication_js_1.AuthInfo(HeaderNames_js_1.HeaderNames.Authorization, token === undefined ? undefined : CognitiveTokenAuthentication.privTokenPrefix + token));\n }\n}\nexports.CognitiveTokenAuthentication = CognitiveTokenAuthentication;\nCognitiveTokenAuthentication.privTokenPrefix = \"Bearer \";\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,4BAA4B,GAAG,KAAK,CAAC;AAC7C,MAAMC,YAAY,GAAGC,OAAO,CAAC,sBAAsB,CAAC;AACpD,MAAMC,oBAAoB,GAAGD,OAAO,CAAC,sBAAsB,CAAC;AAC5D,MAAME,gBAAgB,GAAGF,OAAO,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