Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
hrn?: HRN
): Promise {
const apiCache = new ApiCacheRepository(settings.cache, hrn);
const baseUrl = apiCache.get(serviceName, serviceVersion);
if (baseUrl) {
return Promise.resolve(baseUrl);
}
const lookUpUrl = getEnvLookUpUrl(settings.environment);
const lookUpApiRequest = new DataStoreRequestBuilder(
settings.downloadManager,
lookUpUrl,
settings.token
);
const apiService = hrn ? LookupApi.resourceAPI : LookupApi.platformAPI;
const params: {
api: string;
version: string;
hrn: string;
region?: string | undefined;
} = {
api: serviceName,
version: serviceVersion,
hrn: ""
};
if (hrn) {
params.hrn = hrn.toString();
}
return apiService(lookUpApiRequest, params)