Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@droz-js/sdk

Package Overview
Dependencies
Maintainers
1
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@droz-js/sdk - npm Package Compare versions

Comparing version 0.2.6 to 0.2.7

2

package.json
{
"name": "@droz-js/sdk",
"description": "Droz SDK",
"version": "0.2.6",
"version": "0.2.7",
"private": false,

@@ -6,0 +6,0 @@ "exports": {

@@ -61,21 +61,23 @@ "use strict";

if (this.tenantConfigs.has(tenant)) {
return this.tenantConfigs.get(tenant);
return await this.tenantConfigs.get(tenant);
}
return await this.discoverTenantConfig(tenant);
}
static async discoverTenantConfig(tenant) {
// fetch instances from discovery service
const data = await fetch(`${helpers_1.serviceDiscoveryEndpoint}/discover/${tenant}`);
const json = await data.json();
const instances = json.instances ?? [];
// validate it's a valid tenant
if (instances.length === 0) {
throw new Error(`Invalid tenant '${tenant}', no instances found on service discovery`);
static discoverTenantConfig(tenant) {
async function promise() {
// fetch instances from discovery service
const data = await fetch(`${helpers_1.serviceDiscoveryEndpoint}/discover/${tenant}`);
const json = await data.json();
const instances = json.instances ?? [];
// validate it's a valid tenant
if (instances.length === 0) {
throw new Error(`Invalid tenant '${tenant}', no instances found on service discovery`);
}
// create tenant config and cache it
return new TenantConfig(tenant, instances);
}
// create tenant config and cache it
const config = new TenantConfig(tenant, instances);
this.tenantConfigs.set(tenant, config);
return config;
this.tenantConfigs.set(tenant, promise());
return this.tenantConfigs.get(tenant);
}
}
exports.DrozSdk = DrozSdk;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc