af-consul
Advanced tools
Comparing version 3.0.5 to 3.0.6
@@ -92,2 +92,7 @@ "use strict"; | ||
registerConfig.check = check; | ||
if (!config.service) { | ||
config.service = {}; | ||
} | ||
config.service.id = serviceId; | ||
config.service.address = address; | ||
return registerConfig; | ||
@@ -94,0 +99,0 @@ }; |
@@ -183,3 +183,3 @@ "use strict"; | ||
const result = await this.consulHealthService({ options: { service: serviceName, passing: true } }); | ||
logger.debug(`No info about service ID ${serviceName}`); | ||
logger.debug(`No info about service ID ${color_1.cyan}${serviceName}`); | ||
return (_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a.Service; | ||
@@ -186,0 +186,0 @@ }, |
@@ -88,4 +88,9 @@ import { getPackageJson, parseMeta, parseTags, removeAroundQuotas } from './lib/utils'; | ||
registerConfig.check = check; | ||
if (!config.service) { | ||
config.service = {}; | ||
} | ||
config.service.id = serviceId; | ||
config.service.address = address; | ||
return registerConfig; | ||
}; | ||
//# sourceMappingURL=get-register-config.js.map |
@@ -180,3 +180,3 @@ /* eslint-disable no-console */ | ||
const result = await this.consulHealthService({ options: { service: serviceName, passing: true } }); | ||
logger.debug(`No info about service ID ${serviceName}`); | ||
logger.debug(`No info about service ID ${cyan}${serviceName}`); | ||
return (_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a.Service; | ||
@@ -183,0 +183,0 @@ }, |
@@ -111,2 +111,6 @@ /// <reference types="node" /> | ||
webServer: any; | ||
service?: { | ||
id?: string; | ||
address?: string; | ||
}; | ||
} | ||
@@ -113,0 +117,0 @@ export declare type TCommonFnResult = any; |
{ | ||
"name": "af-consul", | ||
"version": "3.0.5", | ||
"version": "3.0.6", | ||
"description": "A highly specialized function library", | ||
@@ -35,2 +35,3 @@ "main": "./dist/cjs/src/index.js", | ||
"af-logger": "^2.0.17", | ||
"config": "^3.3.7", | ||
"dotenv": "^11.0.0", | ||
@@ -37,0 +38,0 @@ "eslint": "^8.6.0", |
@@ -96,3 +96,9 @@ import { getPackageJson, parseMeta, parseTags, removeAroundQuotas } from './lib/utils'; | ||
if (!config.service) { | ||
config.service = {}; | ||
} | ||
config.service.id = serviceId; | ||
config.service.address = address; | ||
return registerConfig; | ||
}; |
@@ -131,2 +131,6 @@ import Consul from 'consul'; | ||
webServer: any, | ||
service?: { | ||
id?: string, | ||
address?: string, | ||
}; | ||
} | ||
@@ -195,3 +199,5 @@ | ||
agentServiceList: (apiArgs?: IAPIArgs) => Promise<{ [serviceName: string]: IConsulServiceInfo }>, | ||
catalogServiceList(dc: string, apiArgs?: IAPIArgs): Promise<{ [serviceId: string]: string[] }>, | ||
consulHealthService: (apiArgs: IAPIArgs) => Promise<IConsulHealthServiceInfo[]>, | ||
@@ -198,0 +204,0 @@ getServiceInfo: (serviceName: string) => Promise<Maybe<IConsulServiceInfo>>, |
@@ -218,3 +218,3 @@ /* eslint-disable no-console */ | ||
const result = await this.consulHealthService({ options: { service: serviceName, passing: true } }); | ||
logger.debug(`No info about service ID ${serviceName}`); | ||
logger.debug(`No info about service ID ${cyan}${serviceName}`); | ||
return result?.[0]?.Service; | ||
@@ -221,0 +221,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
302664
4436
23