node-consul-service 1.0.46 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/consul/client.d.ts +4 -5
- package/dist/index.cjs.js +5 -6
- package/dist/index.esm.js +5 -6
- package/package.json +1 -1
package/dist/consul/client.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import Consul from "consul";
|
|
2
|
-
interface
|
|
3
|
-
host
|
|
4
|
-
port
|
|
2
|
+
export interface ConsulClientOptions {
|
|
3
|
+
host?: string;
|
|
4
|
+
port?: number;
|
|
5
5
|
secure?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare function initClient(
|
|
7
|
+
export declare function initClient({ host, port, secure, }: ConsulClientOptions): void;
|
|
8
8
|
export declare function getClient(): Consul;
|
|
9
|
-
export {};
|
package/dist/index.cjs.js
CHANGED
|
@@ -15,14 +15,13 @@ var events = require('events');
|
|
|
15
15
|
|
|
16
16
|
// src/lib/client.ts
|
|
17
17
|
let consulClient = null;
|
|
18
|
-
function initClient(
|
|
19
|
-
|
|
18
|
+
function initClient({ host = "127.0.0.1", port = 8500, secure = false, }) {
|
|
19
|
+
console.log("🚀 ~ secure:", secure, typeof secure);
|
|
20
20
|
consulClient = new Consul({
|
|
21
|
-
host:
|
|
22
|
-
port:
|
|
23
|
-
secure: (
|
|
21
|
+
host: host !== null && host !== void 0 ? host : "127.0.0.1",
|
|
22
|
+
port: port !== null && port !== void 0 ? port : 8500,
|
|
23
|
+
secure: Boolean(secure),
|
|
24
24
|
});
|
|
25
|
-
// optional test connection
|
|
26
25
|
consulClient.agent.self((err) => {
|
|
27
26
|
if (err) {
|
|
28
27
|
console.error("❌ Failed to connect to Consul:", err.message);
|
package/dist/index.esm.js
CHANGED
|
@@ -13,14 +13,13 @@ import { EventEmitter } from 'events';
|
|
|
13
13
|
|
|
14
14
|
// src/lib/client.ts
|
|
15
15
|
let consulClient = null;
|
|
16
|
-
function initClient(
|
|
17
|
-
|
|
16
|
+
function initClient({ host = "127.0.0.1", port = 8500, secure = false, }) {
|
|
17
|
+
console.log("🚀 ~ secure:", secure, typeof secure);
|
|
18
18
|
consulClient = new Consul({
|
|
19
|
-
host:
|
|
20
|
-
port:
|
|
21
|
-
secure: (
|
|
19
|
+
host: host !== null && host !== void 0 ? host : "127.0.0.1",
|
|
20
|
+
port: port !== null && port !== void 0 ? port : 8500,
|
|
21
|
+
secure: Boolean(secure),
|
|
22
22
|
});
|
|
23
|
-
// optional test connection
|
|
24
23
|
consulClient.agent.self((err) => {
|
|
25
24
|
if (err) {
|
|
26
25
|
console.error("❌ Failed to connect to Consul:", err.message);
|