From 11a1576495eb9f4f10aa1bcfa711e499efabe54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Mon, 15 Jul 2024 14:57:31 +0100 Subject: [PATCH] chore: revert deprecate instanceid (#180), unleash client 6.1.0 (#184) --- README.md | 2 +- package.json | 4 ++-- src/config.ts | 4 ---- src/create-client.ts | 2 ++ yarn.lock | 8 ++++---- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8505ac9..022d80f 100644 --- a/README.md +++ b/README.md @@ -367,7 +367,7 @@ You **must configure** these three variables for the proxy to start successfully | n/a | `PORT` or `PROXY_PORT` | 3000 | no | The port where the proxy should listen. | | proxyBasePath | `PROXY_BASE_PATH` | "" | no | The base path to run the proxy from. "/proxy" will be added at the end. For instance, if `proxyBasePath` is `"base/path"`, the proxy will run at `/base/path/proxy`. | | unleashAppName | `UNLEASH_APP_NAME` | "unleash-proxy" | no | App name to used when registering with Unleash | -| unleashInstanceId | `UNLEASH_INSTANCE_ID` | `generated` | deprecated | Unleash instance id to used when registering with Unleash | +| unleashInstanceId | `UNLEASH_INSTANCE_ID` | `generated` | no | Unleash instance id to used when registering with Unleash | | refreshInterval | `UNLEASH_FETCH_INTERVAL` | 5000 | no | How often the proxy should query Unleash for updates, defined in ms. | | metricsInterval | `UNLEASH_METRICS_INTERVAL` | 30000 | no | How often the proxy should send usage metrics back to Unleash, defined in ms. | | metricsJitter | `UNLEASH_METRICS_JITTER` | 0 | no | Adds jitter to the metrics interval to avoid multiple instances sending metrics at the same time, defined in ms. | diff --git a/package.json b/package.json index adc6f34..617ff14 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@unleash/proxy", - "version": "1.4.2", + "version": "1.4.3", "description": "The Unleash Proxy (Open-Source)", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -46,7 +46,7 @@ "openapi-types": "^11.0.0", "qs": "^6.9.7", "type-is": "^1.6.18", - "unleash-client": "^6.0.0" + "unleash-client": "^6.1.0" }, "devDependencies": { "@apidevtools/swagger-parser": "10.1.0", diff --git a/src/config.ts b/src/config.ts index 6b550b8..e355b2d 100644 --- a/src/config.ts +++ b/src/config.ts @@ -49,10 +49,6 @@ export interface IProxyConfig { unleashUrl: string; unleashApiToken: string; unleashAppName: string; - /** - * @deprecated This property is deprecated and will be removed in a future version. - * Note: This property is currently a no-op (no operation) and does not affect the automatically generated instanceId. - */ unleashInstanceId: string; customStrategies?: Strategy[]; clientKeys: string[]; diff --git a/src/create-client.ts b/src/create-client.ts index 27f4459..8660d59 100644 --- a/src/create-client.ts +++ b/src/create-client.ts @@ -12,6 +12,7 @@ export const createSingletonClient = (config: IProxyConfig): Client => { const unleash = initialize({ url: config.unleashUrl, appName: config.unleashAppName, + instanceId: config.unleashInstanceId, environment: config.environment, refreshInterval: config.refreshInterval, projectName: config.projectName, @@ -48,6 +49,7 @@ export const createNewClient = (config: IProxyConfig): Client => { const unleash = new Unleash({ url: config.unleashUrl, appName: config.unleashAppName, + instanceId: config.unleashInstanceId, environment: config.environment, refreshInterval: config.refreshInterval, projectName: config.projectName, diff --git a/yarn.lock b/yarn.lock index 1e88b6f..cc6fb00 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4962,10 +4962,10 @@ unique-slug@^4.0.0: dependencies: imurmurhash "^0.1.4" -unleash-client@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/unleash-client/-/unleash-client-6.0.0.tgz#03af4bd3177647e356b6c7a572d94ec611c2da4f" - integrity sha512-qvnFtlV5zCGhXC/4Soqe1FCRjes61HuJYXysHwnUplNd5qItX51S9f+oRu2WzIdBp+kiYU5SwT2sSWEJK+OTaQ== +unleash-client@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/unleash-client/-/unleash-client-6.1.0.tgz#b8863bb049b61d702b7c45328d6225a0c9f9b67a" + integrity sha512-dXTnWorA5NfddqZfMPcTe6xl+uu9CxkpR5wLuKKLLpvHuNzMrTlwDOfaQqFHlfPx+8xudQQ0fZx4raNxL3GLOg== dependencies: http-proxy-agent "^7.0.2" https-proxy-agent "^7.0.5"