8
8
StandardResolutionReasons ,
9
9
TypeMismatchError ,
10
10
} from '@openfeature/js-sdk' ;
11
- import axios , { AxiosRequestConfig } from 'axios' ;
11
+ import axios from 'axios' ;
12
12
import { transformContext } from './context-transformer' ;
13
13
import { ProxyNotReady } from './errors/proxyNotReady' ;
14
14
import { ProxyTimeout } from './errors/proxyTimeout' ;
@@ -55,7 +55,7 @@ export class GoFeatureFlagProvider implements Provider {
55
55
* @throws {ProxyTimeout } When the HTTP call is timing out
56
56
* @throws {UnknownError } When an unknown error occurs
57
57
* @throws {TypeMismatchError } When the type of the variation is not the one expected
58
- * @throws {FlagNotFoundError } When the flag does not exists
58
+ * @throws {FlagNotFoundError } When the flag does not exist
59
59
*/
60
60
async resolveBooleanEvaluation (
61
61
flagKey : string ,
@@ -80,7 +80,7 @@ export class GoFeatureFlagProvider implements Provider {
80
80
* @throws {ProxyTimeout } When the HTTP call is timing out
81
81
* @throws {UnknownError } When an unknown error occurs
82
82
* @throws {TypeMismatchError } When the type of the variation is not the one expected
83
- * @throws {FlagNotFoundError } When the flag does not exists
83
+ * @throws {FlagNotFoundError } When the flag does not exist
84
84
*/
85
85
async resolveStringEvaluation (
86
86
flagKey : string ,
@@ -105,7 +105,7 @@ export class GoFeatureFlagProvider implements Provider {
105
105
* @throws {ProxyTimeout } When the HTTP call is timing out
106
106
* @throws {UnknownError } When an unknown error occurs
107
107
* @throws {TypeMismatchError } When the type of the variation is not the one expected
108
- * @throws {FlagNotFoundError } When the flag does not exists
108
+ * @throws {FlagNotFoundError } When the flag does not exist
109
109
*/
110
110
async resolveNumberEvaluation (
111
111
flagKey : string ,
@@ -130,7 +130,7 @@ export class GoFeatureFlagProvider implements Provider {
130
130
* @throws {ProxyTimeout } When the HTTP call is timing out
131
131
* @throws {UnknownError } When an unknown error occurs
132
132
* @throws {TypeMismatchError } When the type of the variation is not the one expected
133
- * @throws {FlagNotFoundError } When the flag does not exists
133
+ * @throws {FlagNotFoundError } When the flag does not exist
134
134
*/
135
135
async resolveObjectEvaluation < U extends JsonValue > (
136
136
flagKey : string ,
@@ -227,15 +227,16 @@ export class GoFeatureFlagProvider implements Provider {
227
227
228
228
// Case of the flag is disabled
229
229
if ( apiResponseData . reason === StandardResolutionReasons . DISABLED ) {
230
- // we don't set a variant since we are using the default value and we are not able to know
230
+ // we don't set a variant since we are using the default value, and we are not able to know
231
231
// which variant it is.
232
232
return { value : defaultValue , reason : apiResponseData . reason } ;
233
233
}
234
234
235
235
const sdkResponse : ResolutionDetails < T > = {
236
236
value : apiResponseData . value ,
237
237
variant : apiResponseData . variationType ,
238
- reason : apiResponseData . reason ?. toString ( ) || 'UNKNOWN'
238
+ reason : apiResponseData . reason ?. toString ( ) || 'UNKNOWN' ,
239
+ flagMetadata : apiResponseData . metadata || undefined ,
239
240
} ;
240
241
if ( Object . values ( ErrorCode ) . includes ( apiResponseData . errorCode as ErrorCode ) ) {
241
242
sdkResponse . errorCode = ErrorCode [ apiResponseData . errorCode as ErrorCode ] ;
0 commit comments