@yobytechautomation/config-lib 0.3.3 → 0.3.5

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.
@@ -112,9 +112,16 @@ class BaseConfigServiceImpl {
112
112
  .update(apiKey + machineId)
113
113
  .digest("hex");
114
114
  console.log('DEBUG SIGNATURE:', signature);
115
- const clientIp = await axios_1.default.get('https://api.ipify.org?format=json')
116
- .then(res => res.data.ip)
117
- .catch(() => 'unknown');
115
+ let clientIp = 'unknown';
116
+ try {
117
+ const res = await axios_1.default.get('https://api.ipify.org?format=json', {
118
+ timeout: 2000,
119
+ });
120
+ clientIp = res.data.ip;
121
+ }
122
+ catch (e) {
123
+ console.warn('⚠️ Could not fetch public IP, using fallback');
124
+ }
118
125
  const res = await axios_1.default.get(url, {
119
126
  headers: {
120
127
  "x-api-key": apiKey,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yobytechautomation/config-lib",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Shared multi-environment configuration helpers for SDC NestJS services",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",