UNPKG

card-management-sdk

Version:

The Shell Card Management API is REST-based and employs OAUTH 2.0,Basic and ApiKey authentication. The API endpoints accept JSON-encoded request bodies, return JSON-encoded responses and use standard HTTP response codes. All resources are located in the S

28 lines 1.28 kB
"use strict"; /** * Shell Card Management 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