Comparing version 2.0.0-next.2 to 2.0.0-next.3
@@ -30,3 +30,3 @@ import { CommonOptions, Consul } from "../consul"; | ||
interface RegisterOptions extends CommonOptions { | ||
export interface CheckOptions { | ||
name: string; | ||
@@ -36,4 +36,10 @@ id?: string; | ||
http?: string; | ||
body?: string; | ||
header?: Record<string, string>; | ||
disableredirects?: boolean; | ||
h2ping?: string; | ||
h2pingusetls?: boolean; | ||
tlsskipverify?: boolean; | ||
tcp?: string; | ||
udp?: string; | ||
args?: string[]; | ||
@@ -45,2 +51,3 @@ script?: string; | ||
shell?: string; | ||
timeout: string; | ||
interval?: string; | ||
@@ -53,2 +60,3 @@ ttl?: string; | ||
deregistercriticalserviceafter?: string; | ||
failuresbeforewarning?: number; | ||
successbeforepassing?: number; | ||
@@ -58,2 +66,4 @@ failuresbeforecritical?: number; | ||
interface RegisterOptions extends CheckOptions, CommonOptions {} | ||
type RegisterResult = any; | ||
@@ -60,0 +70,0 @@ |
import { CommonOptions, Consul } from "../consul"; | ||
import { CheckOptions } from "./check"; | ||
@@ -9,16 +10,2 @@ interface ListOptions extends CommonOptions { | ||
interface RegisterCheck { | ||
http?: string; | ||
tcp?: string; | ||
script?: string; | ||
dockercontainerid?: string; | ||
shell?: string; | ||
interval?: string; | ||
timeout?: string; | ||
ttl?: string; | ||
notes?: string; | ||
status?: string; | ||
deregistercriticalserviceafter?: string; | ||
} | ||
interface RegisterConnect { | ||
@@ -42,4 +29,4 @@ native?: boolean; | ||
connect?: RegisterConnect; | ||
check?: RegisterCheck; | ||
checks?: RegisterCheck[]; | ||
check?: CheckOptions; | ||
checks?: CheckOptions[]; | ||
} | ||
@@ -46,0 +33,0 @@ |
@@ -305,3 +305,9 @@ "use strict"; | ||
if ( | ||
(src.grpc || src.http || src.tcp || src.args || src.script) && | ||
(src.grpc || | ||
src.h2ping || | ||
src.http || | ||
src.tcp || | ||
src.udp || | ||
src.args || | ||
src.script) && | ||
src.interval | ||
@@ -312,8 +318,20 @@ ) { | ||
if (src.hasOwnProperty("grpcusetls")) dst.GRPCUseTLS = src.grpcusetls; | ||
} else if (src.h2ping) { | ||
dst.H2Ping = src.h2ping; | ||
if (src.hasOwnProperty("h2pingusetls")) { | ||
dst.H2PingUseTLS = src.h2pingusetls; | ||
} | ||
} else if (src.http) { | ||
dst.HTTP = src.http; | ||
if (src.hasOwnProperty("tlsskipverify")) | ||
dst.TLSSkipVerify = src.tlsskipverify; | ||
if (src.hasOwnProperty("body")) dst.Body = src.body; | ||
if (src.hasOwnProperty("disableredirects")) { | ||
dst.DisableRedirects = src.disableredirects; | ||
} | ||
if (src.hasOwnProperty("header")) dst.Header = src.header; | ||
if (src.hasOwnProperty("method")) dst.Method = src.method; | ||
} else if (src.tcp) { | ||
dst.TCP = src.tcp; | ||
if (src.hasOwnProperty("tcpusetls")) dst.TCPUseTLS = src.tcpusetls; | ||
} else if (src.udp) { | ||
dst.UDP = src.udp; | ||
} else { | ||
@@ -330,3 +348,12 @@ if (src.args) { | ||
dst.Interval = src.interval; | ||
if (src.hasOwnProperty("outputmaxsize")) { | ||
dst.OutputMaxSize = src.outputmaxsize; | ||
} | ||
if (src.hasOwnProperty("timeout")) dst.Timeout = src.timeout; | ||
if (src.hasOwnProperty("tlsservername")) { | ||
dst.TLSServerName = src.tlsservername; | ||
} | ||
if (src.hasOwnProperty("tlsskipverify")) { | ||
dst.TLSSkipVerify = src.tlsskipverify; | ||
} | ||
} else if (src.ttl) { | ||
@@ -339,3 +366,3 @@ dst.TTL = src.ttl; | ||
throw new Error( | ||
"args/grpc/http/tcp and interval, ttl, or aliasnode/aliasservice" | ||
"args/grpc/h2ping/http/tcp/udp and interval, ttl, or aliasnode/aliasservice" | ||
); | ||
@@ -348,2 +375,5 @@ } | ||
} | ||
if (src.hasOwnProperty("failuresbeforewarning")) { | ||
dst.FailuresBeforeWarning = src.failuresbeforewarning; | ||
} | ||
if (src.hasOwnProperty("failuresbeforecritical")) { | ||
@@ -350,0 +380,0 @@ dst.FailuresBeforeCritical = src.failuresbeforecritical; |
{ | ||
"name": "consul", | ||
"version": "2.0.0-next.2", | ||
"version": "2.0.0-next.3", | ||
"description": "Consul client", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
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
131934
3104