@logzio-node-toolbox/consul
Advanced tools
Comparing version 0.0.29 to 0.0.30
@@ -1,4 +0,1 @@ | ||
/* eslint-disable no-unused-vars */ | ||
import * as ConsulInstance from 'consul'; | ||
interface AnyObject { | ||
@@ -17,4 +14,5 @@ [key: string]: any; | ||
export interface KeyValueOptions extends ConsulInstance.Kv.SetOptions { | ||
value: any; | ||
export interface KeyValueOptions { | ||
key?: string; | ||
value: AnyObject | string; | ||
} | ||
@@ -52,4 +50,4 @@ | ||
address?: string; | ||
id?: string; | ||
name?: string; | ||
id: string; | ||
name: string; | ||
port?: number; | ||
@@ -73,7 +71,7 @@ } | ||
public constructor(options: ConsulOptions); | ||
public validateConnected(options: ValidateOptions): void; | ||
public validateConnected(options?: ValidateOptions): void; | ||
private buildKey(key: string): { key: string; value: AnyObject }; | ||
public get(key?: string): AnyObject; | ||
public set(options: KeyValueOptions): boolean; | ||
public setString(options: KeyValueOptions): boolean; | ||
public set(options: KeyValueOptions): void; | ||
public setString(options: KeyValueOptions): void; | ||
public keys(key?: string): AnyObject; | ||
@@ -85,3 +83,2 @@ public merge(options: KeyValueOptions): AnyObject; | ||
public close(): void; | ||
public consulInstance: ConsulInstance.Consul; | ||
} | ||
@@ -88,0 +85,0 @@ interface MultiConsulOptions extends ConsulOptions { |
@@ -116,10 +116,5 @@ import retry from 'async-retry'; | ||
key, | ||
value, | ||
...options | ||
value | ||
}) { | ||
return this.consulInstance.kv.set({ | ||
key: this.buildKey(key), | ||
value: JSON.stringify(value), | ||
...options | ||
}); | ||
return this.consulInstance.kv.set(this.buildKey(key), JSON.stringify(value)); | ||
} | ||
@@ -129,10 +124,5 @@ | ||
key, | ||
value, | ||
...options | ||
value | ||
}) { | ||
return this.consulInstance.kv.set({ | ||
key: this.buildKey(key), | ||
value, | ||
...options | ||
}); | ||
return this.consulInstance.kv.set(this.buildKey(key), value); | ||
} | ||
@@ -146,4 +136,3 @@ | ||
key, | ||
value, | ||
...options | ||
value | ||
}) { | ||
@@ -153,7 +142,3 @@ const configValues = await this.get(key); | ||
const newValues = deepMerge(currentValues, value); | ||
await this.set({ | ||
key, | ||
value: newValues, | ||
...options | ||
}); | ||
await this.set(key, newValues); | ||
return newValues; | ||
@@ -216,3 +201,3 @@ } | ||
data, | ||
options | ||
options = {} | ||
} = {}) { | ||
@@ -561,3 +546,3 @@ if (!data.name || !data.id) throw new Error('must provide name and id to register for consul service discovery'); | ||
})('versions', []).push({ | ||
version: '3.11.0', | ||
version: '3.12.0', | ||
mode: 'global', | ||
@@ -940,4 +925,2 @@ copyright: '© 2021 Denis Pushkarev (zloirock.ru)' | ||
var engineIsNode = classofRaw(global$1.process) == 'process'; | ||
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || ''; | ||
@@ -952,3 +935,3 @@ | ||
match = v8.split('.'); | ||
version = match[0] + match[1]; | ||
version = match[0] < 4 ? 1 : match[0] + match[1]; | ||
} else if (engineUserAgent) { | ||
@@ -965,2 +948,4 @@ match = engineUserAgent.match(/Edge\/(\d+)/); | ||
/* eslint-disable es/no-symbol -- required for testing */ | ||
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing | ||
@@ -970,6 +955,5 @@ | ||
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () { | ||
// eslint-disable-next-line es/no-symbol -- required for testing | ||
return !Symbol.sham && ( // Chrome 38 Symbol has incorrect toString conversion | ||
return !String(Symbol()) || // Chrome 38 Symbol has incorrect toString conversion | ||
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances | ||
engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41); | ||
!Symbol.sham && engineV8Version && engineV8Version < 41; | ||
}); | ||
@@ -976,0 +960,0 @@ |
{ | ||
"name": "@logzio-node-toolbox/consul", | ||
"version": "0.0.29", | ||
"version": "0.0.30", | ||
"description": "Consul easy use for json configs and service discovery", | ||
@@ -31,3 +31,2 @@ "main": "dist/index.cjs", | ||
"dependencies": { | ||
"@types/consul": "0.23.34", | ||
"async-retry": "1.3.1", | ||
@@ -37,2 +36,2 @@ "consul": "0.40.0", | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3
79573
2165
- Removed@types/consul@0.23.34
- Removed@types/consul@0.23.34(transitive)
- Removed@types/node@22.9.1(transitive)
- Removedundici-types@6.19.8(transitive)