@spotify-confidence/client-http
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -50,5 +50,6 @@ import { Configuration, ResolveContext } from './Configuration'; | ||
constructor(options: ConfidenceClientOptions); | ||
resolve(context: ResolveContext, options?: { | ||
resolve(context: ResolveContext, { signal, ...options }?: { | ||
apply?: boolean; | ||
flags: string[]; | ||
flags?: string[]; | ||
signal?: AbortSignal; | ||
}): Promise<Configuration>; | ||
@@ -55,0 +56,0 @@ apply(flags: AppliedFlag[], resolveToken: string): Promise<void>; |
@@ -38,7 +38,13 @@ "use strict"; | ||
} | ||
resolve(context, options) { | ||
resolve(context, _a = {}) { | ||
var { signal } = _a, options = __rest(_a, ["signal"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const payload = Object.assign({ clientSecret: this.clientSecret, evaluationContext: context, apply: this.backendApplyEnabled, sdk: this.sdk }, options); | ||
const controller = new AbortController(); | ||
const timeoutId = setTimeout(() => controller.abort(), this.timeout); | ||
if (signal) { | ||
signal.addEventListener('abort', () => { | ||
controller.abort(signal.reason); | ||
}); | ||
} | ||
const timeoutId = Number.isFinite(this.timeout) ? setTimeout(() => controller.abort(), this.timeout) : 0; | ||
const response = yield this.fetchImplementation(`${this.baseUrl}/v1/flags:resolve`, { | ||
@@ -45,0 +51,0 @@ method: 'POST', |
@@ -50,5 +50,6 @@ import { Configuration, ResolveContext } from './Configuration'; | ||
constructor(options: ConfidenceClientOptions); | ||
resolve(context: ResolveContext, options?: { | ||
resolve(context: ResolveContext, { signal, ...options }?: { | ||
apply?: boolean; | ||
flags: string[]; | ||
flags?: string[]; | ||
signal?: AbortSignal; | ||
}): Promise<Configuration>; | ||
@@ -55,0 +56,0 @@ apply(flags: AppliedFlag[], resolveToken: string): Promise<void>; |
@@ -35,7 +35,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
resolve(context, options) { | ||
resolve(context, _a = {}) { | ||
var { signal } = _a, options = __rest(_a, ["signal"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const payload = Object.assign({ clientSecret: this.clientSecret, evaluationContext: context, apply: this.backendApplyEnabled, sdk: this.sdk }, options); | ||
const controller = new AbortController(); | ||
const timeoutId = setTimeout(() => controller.abort(), this.timeout); | ||
if (signal) { | ||
signal.addEventListener('abort', () => { | ||
controller.abort(signal.reason); | ||
}); | ||
} | ||
const timeoutId = Number.isFinite(this.timeout) ? setTimeout(() => controller.abort(), this.timeout) : 0; | ||
const response = yield this.fetchImplementation(`${this.baseUrl}/v1/flags:resolve`, { | ||
@@ -42,0 +48,0 @@ method: 'POST', |
@@ -50,5 +50,6 @@ import { Configuration, ResolveContext } from './Configuration'; | ||
constructor(options: ConfidenceClientOptions); | ||
resolve(context: ResolveContext, options?: { | ||
resolve(context: ResolveContext, { signal, ...options }?: { | ||
apply?: boolean; | ||
flags: string[]; | ||
flags?: string[]; | ||
signal?: AbortSignal; | ||
}): Promise<Configuration>; | ||
@@ -55,0 +56,0 @@ apply(flags: AppliedFlag[], resolveToken: string): Promise<void>; |
@@ -35,7 +35,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
resolve(context, options) { | ||
resolve(context, _a = {}) { | ||
var { signal } = _a, options = __rest(_a, ["signal"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const payload = Object.assign({ clientSecret: this.clientSecret, evaluationContext: context, apply: this.backendApplyEnabled, sdk: this.sdk }, options); | ||
const controller = new AbortController(); | ||
const timeoutId = setTimeout(() => controller.abort(), this.timeout); | ||
if (signal) { | ||
signal.addEventListener('abort', () => { | ||
controller.abort(signal.reason); | ||
}); | ||
} | ||
const timeoutId = Number.isFinite(this.timeout) ? setTimeout(() => controller.abort(), this.timeout) : 0; | ||
const response = yield this.fetchImplementation(`${this.baseUrl}/v1/flags:resolve`, { | ||
@@ -42,0 +48,0 @@ method: 'POST', |
# Changelog | ||
## [0.1.6](https://github.com/spotify/confidence-openfeature-provider-js/compare/client-http-v0.1.5...client-http-v0.1.6) (2024-05-03) | ||
### ✨ New Features | ||
* resolve flags on context change ([#128](https://github.com/spotify/confidence-openfeature-provider-js/issues/128)) ([184d5c5](https://github.com/spotify/confidence-openfeature-provider-js/commit/184d5c56f3ee4e428c72a1fa500197b9e7aca8d7)) | ||
## [0.1.5](https://github.com/spotify/confidence-openfeature-provider-js/compare/client-http-v0.1.4...client-http-v0.1.5) (2024-04-04) | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "@spotify-confidence/client-http", | ||
"license": "Apache-2.0", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"module": "build/esm/index.js", | ||
@@ -21,3 +21,3 @@ "main": "build/cjs/index.js", | ||
}, | ||
"gitHead": "86023f5a9cb5c641213ae7754be2395174754119" | ||
"gitHead": "9cc79a28acd7b00a5e7e341229081e854d0b5292" | ||
} |
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
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
245265
1707