data-and-reporting-sdk
Version:
Data And Reporting product consists of API's which provides details of transaction and invoice informations about shell cards. The Shell Card Transaction and Invoice API is REST-based and employs Basic authentication in Version 1 and Oauth authentication
28 lines • 1.28 kB
JavaScript
/**
* Shell Data & Reporting APIsLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.createAuthProviderFromConfig = createAuthProviderFromConfig;
var authentication_js_1 = require("./authentication.js");
function createAuthProviderFromConfig(config, bearerToken) {
var authConfig = {
bearerToken: config.clientCredentialsAuthCredentials &&
(0, authentication_js_1.requestAuthenticationProvider)(config.clientCredentialsAuthCredentials.oAuthToken, bearerTokenTokenProvider(bearerToken, config.clientCredentialsAuthCredentials.oAuthTokenProvider), config.clientCredentialsAuthCredentials.oAuthOnTokenUpdate, {
clockSkew: config.clientCredentialsAuthCredentials.oAuthClockSkew,
}),
};
return (0, authentication_js_1.compositeAuthenticationProvider)(authConfig);
}
function bearerTokenTokenProvider(bearerToken, defaultProvider) {
return function (token) {
var manager = bearerToken();
if (defaultProvider === undefined) {
return manager.updateToken(token);
}
return defaultProvider(token, manager);
};
}
//# sourceMappingURL=authProvider.js.map
;