mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Update eureka-js-client to 4.4 typing
This commit is contained in:
@@ -19,3 +19,27 @@ const client = new Eureka({
|
||||
port: 32768,
|
||||
}
|
||||
});
|
||||
|
||||
// example configuration against newer Eureka (https://www.npmjs.com/package/eureka-js-client#400-bad-request-errors-from-eureka-server)
|
||||
const newerClient = new Eureka({
|
||||
// application instance information
|
||||
instance: {
|
||||
app: 'jqservice',
|
||||
hostName: 'localhost',
|
||||
ipAddr: '127.0.0.1',
|
||||
port: {
|
||||
$: 443,
|
||||
'@enabled': true
|
||||
},
|
||||
vipAddress: 'jq.test.something.com',
|
||||
dataCenterInfo: {
|
||||
'@class': 'com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo',
|
||||
name: 'MyOwn',
|
||||
},
|
||||
},
|
||||
eureka: {
|
||||
// eureka server host / port
|
||||
host: '192.168.99.100',
|
||||
port: 32768,
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+8
-3
@@ -1,6 +1,6 @@
|
||||
// Type definitions for eureka-js-client 4.3
|
||||
// Type definitions for eureka-js-client 4.4
|
||||
// Project: https://github.com/jquatier/eureka-js-client
|
||||
// Definitions by: Ilko Hoffmann <https://github.com/Schnillz>
|
||||
// Definitions by: Ilko Hoffmann <https://github.com/Schnillz>, Karl O. <https://github.com/karl-run>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export class Eureka {
|
||||
@@ -26,7 +26,7 @@ export namespace EurekaClient {
|
||||
ipAddr: string;
|
||||
vipAddress: string;
|
||||
dataCenterInfo: DataCenterInfo;
|
||||
port?: number;
|
||||
port?: number | LegacyPortWrapper;
|
||||
instanceId?: string;
|
||||
appGroupName?: string;
|
||||
sid?: string;
|
||||
@@ -61,6 +61,10 @@ export namespace EurekaClient {
|
||||
useLocalMetadata?: boolean;
|
||||
preferIpAddress?: boolean;
|
||||
}
|
||||
interface LegacyPortWrapper {
|
||||
'$': number;
|
||||
'@enabled': boolean;
|
||||
}
|
||||
interface PortWrapper {
|
||||
enabled: boolean;
|
||||
port: number;
|
||||
@@ -71,5 +75,6 @@ export namespace EurekaClient {
|
||||
}
|
||||
interface DataCenterInfo {
|
||||
name: DataCenterName;
|
||||
'@class'?: string;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user