From 7e9958d8b645cbb20752e9c7c19e9132904aa328 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Wed, 7 Feb 2024 10:01:05 +0100 Subject: [PATCH] feat: sdk with double start prevention (#6146) --- package.json | 2 +- src/lib/proxy/proxy-repository.ts | 10 +++++++++- yarn.lock | 8 ++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 217a524763..9f7b25090b 100644 --- a/package.json +++ b/package.json @@ -145,7 +145,7 @@ "stoppable": "^1.1.0", "ts-toolbelt": "^9.6.0", "type-is": "^1.6.18", - "unleash-client": "5.3.2", + "unleash-client": "5.5.0-beta.0", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/src/lib/proxy/proxy-repository.ts b/src/lib/proxy/proxy-repository.ts index 144f9d2e56..e55ec91815 100644 --- a/src/lib/proxy/proxy-repository.ts +++ b/src/lib/proxy/proxy-repository.ts @@ -1,7 +1,10 @@ import EventEmitter from 'events'; import { RepositoryInterface } from 'unleash-client/lib/repository'; import { Segment } from 'unleash-client/lib/strategy/strategy'; -import { FeatureInterface } from 'unleash-client/lib/feature'; +import { + EnhancedFeatureInterface, + FeatureInterface, +} from 'unleash-client/lib/feature'; import { IApiUser } from '../types/api-user'; import { IUnleashConfig, IUnleashServices, IUnleashStores } from '../types'; import { @@ -68,6 +71,11 @@ export class ProxyRepository this.interval = config.frontendApi.refreshIntervalInMs; } + getTogglesWithSegmentData(): EnhancedFeatureInterface[] { + // TODO: add real implementation + return []; + } + getSegment(id: number): Segment | undefined { return this.segments.find((segment) => segment.id === id); } diff --git a/yarn.lock b/yarn.lock index d68d4cb81e..1fbb815f43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7152,10 +7152,10 @@ universalify@^0.2.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== -unleash-client@5.3.2: - version "5.3.2" - resolved "https://registry.yarnpkg.com/unleash-client/-/unleash-client-5.3.2.tgz#d4612d6893b2175fd23a038c85c9deaf2d60a1af" - integrity sha512-0iR0bzvWoJSuLPr9VKQhu1qr2jV3UeXcnMJylTzeeZWNhD6dxQSYS1bVl1wGhTRo/ucXnk5Lx66zmreIqojp8Q== +unleash-client@5.5.0-beta.0: + version "5.5.0-beta.0" + resolved "https://registry.yarnpkg.com/unleash-client/-/unleash-client-5.5.0-beta.0.tgz#8e9b8778fa2027fa282dcc9d31e0306a44bbb763" + integrity sha512-/HwClfmGKl6Pl+X8LTe4xCjxjRzgolx9DXBQFVSN6FDLGUHqf7BJWeYbZ5DSu5AaNVG/9dvksmrdjMXDiPSejQ== dependencies: ip "^1.1.8" make-fetch-happen "^10.2.1"