UNPKG

@sap-cloud-sdk/connectivity

Version:

SAP Cloud SDK for JavaScript connectivity

21 lines 921 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.destinationServiceCache = void 0; const cache_1 = require("../cache"); const destination_cache_1 = require("./destination-cache"); const DestinationServiceCache = (cache) => ({ retrieveDestinationsFromCache: (targetUrl, decodedJwt) => cache.get((0, destination_cache_1.getDestinationCacheKey)(decodedJwt, targetUrl, 'tenant')), cacheRetrievedDestinations: (destinationServiceUri, decodedJwt, destinations) => { const key = (0, destination_cache_1.getDestinationCacheKey)(decodedJwt, destinationServiceUri, 'tenant'); cache.set(key, { entry: destinations }); }, clear: () => { cache.clear(); }, getCacheInstance: () => cache }); /** * @internal */ exports.destinationServiceCache = DestinationServiceCache(new cache_1.Cache(300000)); //# sourceMappingURL=destination-service-cache.js.map