@spotify-confidence/openfeature-server-provider-local 0.15.0 → 0.15.1
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.
- package/CHANGELOG.md +7 -0
- package/dist/index.fetch.d.ts +3 -0
- package/dist/index.fetch.js +31 -8
- package/dist/index.inlined.d.ts +3 -0
- package/dist/index.inlined.js +31 -8
- package/dist/index.node.d.ts +3 -0
- package/dist/index.node.js +31 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.15.1](https://github.com/spotify/confidence-resolver/compare/openfeature-provider-js-v0.15.0...openfeature-provider-js-v0.15.1) (2026-06-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* register telemetry on bundle resolve path ([#431](https://github.com/spotify/confidence-resolver/issues/431)) ([2ce5c9a](https://github.com/spotify/confidence-resolver/commit/2ce5c9a5eb50be27b3aa8d98bfb1be469d23b7c0))
|
|
9
|
+
|
|
3
10
|
## [0.15.0](https://github.com/spotify/confidence-resolver/compare/openfeature-provider-js-v0.14.2...openfeature-provider-js-v0.15.0) (2026-05-28)
|
|
4
11
|
|
|
5
12
|
|
package/dist/index.fetch.d.ts
CHANGED
|
@@ -86,6 +86,8 @@ declare enum ResolveReason {
|
|
|
86
86
|
RESOLVE_REASON_TYPE_MISMATCH = 9,
|
|
87
87
|
/** RESOLVE_REASON_FLAG_NOT_FOUND - The flag was not found in the resolve response */
|
|
88
88
|
RESOLVE_REASON_FLAG_NOT_FOUND = 10,
|
|
89
|
+
/** RESOLVE_REASON_BUNDLE - A bundle resolve was performed (multiple flags resolved at once) */
|
|
90
|
+
RESOLVE_REASON_BUNDLE = 11,
|
|
89
91
|
UNRECOGNIZED = -1,
|
|
90
92
|
}
|
|
91
93
|
declare enum SdkId {
|
|
@@ -514,6 +516,7 @@ declare class ConfidenceServerProviderLocal implements Provider {
|
|
|
514
516
|
initialize(context?: EvaluationContext): Promise<void>;
|
|
515
517
|
onClose(): Promise<void>;
|
|
516
518
|
resolve(context: EvaluationContext, flagNames: string[], apply?: boolean): Promise<FlagBundle$1>;
|
|
519
|
+
private resolveFlags;
|
|
517
520
|
evaluate<T extends JsonValue>(flagKey: string, defaultValue: T, context: EvaluationContext): Promise<ResolutionDetails<T>>;
|
|
518
521
|
private resolveProcess;
|
|
519
522
|
private handleMaterializationWrites;
|
package/dist/index.fetch.js
CHANGED
|
@@ -776,6 +776,7 @@ let ResolveReason = /* @__PURE__ */ function(ResolveReason$1) {
|
|
|
776
776
|
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED"] = 8] = "RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED";
|
|
777
777
|
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_TYPE_MISMATCH"] = 9] = "RESOLVE_REASON_TYPE_MISMATCH";
|
|
778
778
|
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_FLAG_NOT_FOUND"] = 10] = "RESOLVE_REASON_FLAG_NOT_FOUND";
|
|
779
|
+
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_BUNDLE"] = 11] = "RESOLVE_REASON_BUNDLE";
|
|
779
780
|
ResolveReason$1[ResolveReason$1["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
780
781
|
return ResolveReason$1;
|
|
781
782
|
}({});
|
|
@@ -803,6 +804,8 @@ function resolveReasonFromJSON(object) {
|
|
|
803
804
|
case "RESOLVE_REASON_TYPE_MISMATCH": return ResolveReason.RESOLVE_REASON_TYPE_MISMATCH;
|
|
804
805
|
case 10:
|
|
805
806
|
case "RESOLVE_REASON_FLAG_NOT_FOUND": return ResolveReason.RESOLVE_REASON_FLAG_NOT_FOUND;
|
|
807
|
+
case 11:
|
|
808
|
+
case "RESOLVE_REASON_BUNDLE": return ResolveReason.RESOLVE_REASON_BUNDLE;
|
|
806
809
|
case -1:
|
|
807
810
|
case "UNRECOGNIZED":
|
|
808
811
|
default: return ResolveReason.UNRECOGNIZED;
|
|
@@ -821,6 +824,7 @@ function resolveReasonToJSON(object) {
|
|
|
821
824
|
case ResolveReason.RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED: return "RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED";
|
|
822
825
|
case ResolveReason.RESOLVE_REASON_TYPE_MISMATCH: return "RESOLVE_REASON_TYPE_MISMATCH";
|
|
823
826
|
case ResolveReason.RESOLVE_REASON_FLAG_NOT_FOUND: return "RESOLVE_REASON_FLAG_NOT_FOUND";
|
|
827
|
+
case ResolveReason.RESOLVE_REASON_BUNDLE: return "RESOLVE_REASON_BUNDLE";
|
|
824
828
|
case ResolveReason.UNRECOGNIZED:
|
|
825
829
|
default: return "UNRECOGNIZED";
|
|
826
830
|
}
|
|
@@ -1430,7 +1434,7 @@ function isObject(value) {
|
|
|
1430
1434
|
function isSet$3(value) {
|
|
1431
1435
|
return value !== null && value !== void 0;
|
|
1432
1436
|
}
|
|
1433
|
-
const VERSION = "0.15.
|
|
1437
|
+
const VERSION = "0.15.1";
|
|
1434
1438
|
const NOOP_LOG_FN = Object.assign(() => {}, { enabled: false });
|
|
1435
1439
|
const debugBackend = loadDebug();
|
|
1436
1440
|
const logger$2 = new class LoggerImpl {
|
|
@@ -2896,6 +2900,24 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
2896
2900
|
this.main.abort();
|
|
2897
2901
|
}
|
|
2898
2902
|
async resolve(context, flagNames, apply = false) {
|
|
2903
|
+
const startMs = performance.now();
|
|
2904
|
+
let reason = ResolveReason.RESOLVE_REASON_BUNDLE;
|
|
2905
|
+
try {
|
|
2906
|
+
return await this.resolveFlags(context, flagNames, apply);
|
|
2907
|
+
} catch (err) {
|
|
2908
|
+
reason = ResolveReason.RESOLVE_REASON_ERROR;
|
|
2909
|
+
return error(ErrorCode.GENERAL, String(err));
|
|
2910
|
+
} finally {
|
|
2911
|
+
const latencyUs = Math.round((performance.now() - startMs) * 1e3);
|
|
2912
|
+
try {
|
|
2913
|
+
this.resolver.registerResolve({
|
|
2914
|
+
reason,
|
|
2915
|
+
latencyUs
|
|
2916
|
+
});
|
|
2917
|
+
} catch {}
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
async resolveFlags(context, flagNames, apply) {
|
|
2899
2921
|
const resolveRequest = {
|
|
2900
2922
|
flags: flagNames.map((name) => `flags/${name}`),
|
|
2901
2923
|
evaluationContext: ConfidenceServerProviderLocal.convertEvaluationContext(context),
|
|
@@ -2906,12 +2928,8 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
2906
2928
|
version: VERSION
|
|
2907
2929
|
}
|
|
2908
2930
|
};
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
return create(await this.resolveProcess(processRequest));
|
|
2912
|
-
} catch (err) {
|
|
2913
|
-
return error(ErrorCode.GENERAL, String(err));
|
|
2914
|
-
}
|
|
2931
|
+
const processRequest = this.materializationStore ? { deferredMaterializations: resolveRequest } : { withoutMaterializations: resolveRequest };
|
|
2932
|
+
return create(await this.resolveProcess(processRequest));
|
|
2915
2933
|
}
|
|
2916
2934
|
async evaluate(flagKey, defaultValue, context) {
|
|
2917
2935
|
const startMs = performance.now();
|
|
@@ -2919,7 +2937,12 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
2919
2937
|
const [flagName] = flagKey.split(".", 1);
|
|
2920
2938
|
const { _confidence_skip_apply,...cleanContext } = context;
|
|
2921
2939
|
const skipApply = _confidence_skip_apply === true;
|
|
2922
|
-
|
|
2940
|
+
let resolution;
|
|
2941
|
+
try {
|
|
2942
|
+
resolution = await this.resolveFlags(cleanContext, [flagName], !skipApply);
|
|
2943
|
+
} catch (err) {
|
|
2944
|
+
resolution = error(ErrorCode.GENERAL, String(err));
|
|
2945
|
+
}
|
|
2923
2946
|
const result = resolve(resolution, flagKey, defaultValue, logger$1);
|
|
2924
2947
|
const latencyUs = Math.round((performance.now() - startMs) * 1e3);
|
|
2925
2948
|
let reason;
|
package/dist/index.inlined.d.ts
CHANGED
|
@@ -86,6 +86,8 @@ declare enum ResolveReason {
|
|
|
86
86
|
RESOLVE_REASON_TYPE_MISMATCH = 9,
|
|
87
87
|
/** RESOLVE_REASON_FLAG_NOT_FOUND - The flag was not found in the resolve response */
|
|
88
88
|
RESOLVE_REASON_FLAG_NOT_FOUND = 10,
|
|
89
|
+
/** RESOLVE_REASON_BUNDLE - A bundle resolve was performed (multiple flags resolved at once) */
|
|
90
|
+
RESOLVE_REASON_BUNDLE = 11,
|
|
89
91
|
UNRECOGNIZED = -1,
|
|
90
92
|
}
|
|
91
93
|
declare enum SdkId {
|
|
@@ -514,6 +516,7 @@ declare class ConfidenceServerProviderLocal implements Provider {
|
|
|
514
516
|
initialize(context?: EvaluationContext): Promise<void>;
|
|
515
517
|
onClose(): Promise<void>;
|
|
516
518
|
resolve(context: EvaluationContext, flagNames: string[], apply?: boolean): Promise<FlagBundle$1>;
|
|
519
|
+
private resolveFlags;
|
|
517
520
|
evaluate<T extends JsonValue>(flagKey: string, defaultValue: T, context: EvaluationContext): Promise<ResolutionDetails<T>>;
|
|
518
521
|
private resolveProcess;
|
|
519
522
|
private handleMaterializationWrites;
|
package/dist/index.inlined.js
CHANGED
|
@@ -776,6 +776,7 @@ let ResolveReason = /* @__PURE__ */ function(ResolveReason$1) {
|
|
|
776
776
|
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED"] = 8] = "RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED";
|
|
777
777
|
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_TYPE_MISMATCH"] = 9] = "RESOLVE_REASON_TYPE_MISMATCH";
|
|
778
778
|
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_FLAG_NOT_FOUND"] = 10] = "RESOLVE_REASON_FLAG_NOT_FOUND";
|
|
779
|
+
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_BUNDLE"] = 11] = "RESOLVE_REASON_BUNDLE";
|
|
779
780
|
ResolveReason$1[ResolveReason$1["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
780
781
|
return ResolveReason$1;
|
|
781
782
|
}({});
|
|
@@ -803,6 +804,8 @@ function resolveReasonFromJSON(object) {
|
|
|
803
804
|
case "RESOLVE_REASON_TYPE_MISMATCH": return ResolveReason.RESOLVE_REASON_TYPE_MISMATCH;
|
|
804
805
|
case 10:
|
|
805
806
|
case "RESOLVE_REASON_FLAG_NOT_FOUND": return ResolveReason.RESOLVE_REASON_FLAG_NOT_FOUND;
|
|
807
|
+
case 11:
|
|
808
|
+
case "RESOLVE_REASON_BUNDLE": return ResolveReason.RESOLVE_REASON_BUNDLE;
|
|
806
809
|
case -1:
|
|
807
810
|
case "UNRECOGNIZED":
|
|
808
811
|
default: return ResolveReason.UNRECOGNIZED;
|
|
@@ -821,6 +824,7 @@ function resolveReasonToJSON(object) {
|
|
|
821
824
|
case ResolveReason.RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED: return "RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED";
|
|
822
825
|
case ResolveReason.RESOLVE_REASON_TYPE_MISMATCH: return "RESOLVE_REASON_TYPE_MISMATCH";
|
|
823
826
|
case ResolveReason.RESOLVE_REASON_FLAG_NOT_FOUND: return "RESOLVE_REASON_FLAG_NOT_FOUND";
|
|
827
|
+
case ResolveReason.RESOLVE_REASON_BUNDLE: return "RESOLVE_REASON_BUNDLE";
|
|
824
828
|
case ResolveReason.UNRECOGNIZED:
|
|
825
829
|
default: return "UNRECOGNIZED";
|
|
826
830
|
}
|
|
@@ -1430,7 +1434,7 @@ function isObject(value) {
|
|
|
1430
1434
|
function isSet$3(value) {
|
|
1431
1435
|
return value !== null && value !== void 0;
|
|
1432
1436
|
}
|
|
1433
|
-
const VERSION = "0.15.
|
|
1437
|
+
const VERSION = "0.15.1";
|
|
1434
1438
|
const NOOP_LOG_FN = Object.assign(() => {}, { enabled: false });
|
|
1435
1439
|
const debugBackend = loadDebug();
|
|
1436
1440
|
const logger$2 = new class LoggerImpl {
|
|
@@ -2896,6 +2900,24 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
2896
2900
|
this.main.abort();
|
|
2897
2901
|
}
|
|
2898
2902
|
async resolve(context, flagNames, apply = false) {
|
|
2903
|
+
const startMs = performance.now();
|
|
2904
|
+
let reason = ResolveReason.RESOLVE_REASON_BUNDLE;
|
|
2905
|
+
try {
|
|
2906
|
+
return await this.resolveFlags(context, flagNames, apply);
|
|
2907
|
+
} catch (err) {
|
|
2908
|
+
reason = ResolveReason.RESOLVE_REASON_ERROR;
|
|
2909
|
+
return error(ErrorCode.GENERAL, String(err));
|
|
2910
|
+
} finally {
|
|
2911
|
+
const latencyUs = Math.round((performance.now() - startMs) * 1e3);
|
|
2912
|
+
try {
|
|
2913
|
+
this.resolver.registerResolve({
|
|
2914
|
+
reason,
|
|
2915
|
+
latencyUs
|
|
2916
|
+
});
|
|
2917
|
+
} catch {}
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
async resolveFlags(context, flagNames, apply) {
|
|
2899
2921
|
const resolveRequest = {
|
|
2900
2922
|
flags: flagNames.map((name) => `flags/${name}`),
|
|
2901
2923
|
evaluationContext: ConfidenceServerProviderLocal.convertEvaluationContext(context),
|
|
@@ -2906,12 +2928,8 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
2906
2928
|
version: VERSION
|
|
2907
2929
|
}
|
|
2908
2930
|
};
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
return create(await this.resolveProcess(processRequest));
|
|
2912
|
-
} catch (err) {
|
|
2913
|
-
return error(ErrorCode.GENERAL, String(err));
|
|
2914
|
-
}
|
|
2931
|
+
const processRequest = this.materializationStore ? { deferredMaterializations: resolveRequest } : { withoutMaterializations: resolveRequest };
|
|
2932
|
+
return create(await this.resolveProcess(processRequest));
|
|
2915
2933
|
}
|
|
2916
2934
|
async evaluate(flagKey, defaultValue, context) {
|
|
2917
2935
|
const startMs = performance.now();
|
|
@@ -2919,7 +2937,12 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
2919
2937
|
const [flagName] = flagKey.split(".", 1);
|
|
2920
2938
|
const { _confidence_skip_apply,...cleanContext } = context;
|
|
2921
2939
|
const skipApply = _confidence_skip_apply === true;
|
|
2922
|
-
|
|
2940
|
+
let resolution;
|
|
2941
|
+
try {
|
|
2942
|
+
resolution = await this.resolveFlags(cleanContext, [flagName], !skipApply);
|
|
2943
|
+
} catch (err) {
|
|
2944
|
+
resolution = error(ErrorCode.GENERAL, String(err));
|
|
2945
|
+
}
|
|
2923
2946
|
const result = resolve(resolution, flagKey, defaultValue, logger$1);
|
|
2924
2947
|
const latencyUs = Math.round((performance.now() - startMs) * 1e3);
|
|
2925
2948
|
let reason;
|
package/dist/index.node.d.ts
CHANGED
|
@@ -86,6 +86,8 @@ declare enum ResolveReason {
|
|
|
86
86
|
RESOLVE_REASON_TYPE_MISMATCH = 9,
|
|
87
87
|
/** RESOLVE_REASON_FLAG_NOT_FOUND - The flag was not found in the resolve response */
|
|
88
88
|
RESOLVE_REASON_FLAG_NOT_FOUND = 10,
|
|
89
|
+
/** RESOLVE_REASON_BUNDLE - A bundle resolve was performed (multiple flags resolved at once) */
|
|
90
|
+
RESOLVE_REASON_BUNDLE = 11,
|
|
89
91
|
UNRECOGNIZED = -1,
|
|
90
92
|
}
|
|
91
93
|
declare enum SdkId {
|
|
@@ -514,6 +516,7 @@ declare class ConfidenceServerProviderLocal implements Provider {
|
|
|
514
516
|
initialize(context?: EvaluationContext): Promise<void>;
|
|
515
517
|
onClose(): Promise<void>;
|
|
516
518
|
resolve(context: EvaluationContext, flagNames: string[], apply?: boolean): Promise<FlagBundle$1>;
|
|
519
|
+
private resolveFlags;
|
|
517
520
|
evaluate<T extends JsonValue>(flagKey: string, defaultValue: T, context: EvaluationContext): Promise<ResolutionDetails<T>>;
|
|
518
521
|
private resolveProcess;
|
|
519
522
|
private handleMaterializationWrites;
|
package/dist/index.node.js
CHANGED
|
@@ -779,6 +779,7 @@ let ResolveReason = /* @__PURE__ */ function(ResolveReason$1) {
|
|
|
779
779
|
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED"] = 8] = "RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED";
|
|
780
780
|
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_TYPE_MISMATCH"] = 9] = "RESOLVE_REASON_TYPE_MISMATCH";
|
|
781
781
|
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_FLAG_NOT_FOUND"] = 10] = "RESOLVE_REASON_FLAG_NOT_FOUND";
|
|
782
|
+
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_BUNDLE"] = 11] = "RESOLVE_REASON_BUNDLE";
|
|
782
783
|
ResolveReason$1[ResolveReason$1["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
783
784
|
return ResolveReason$1;
|
|
784
785
|
}({});
|
|
@@ -806,6 +807,8 @@ function resolveReasonFromJSON(object) {
|
|
|
806
807
|
case "RESOLVE_REASON_TYPE_MISMATCH": return ResolveReason.RESOLVE_REASON_TYPE_MISMATCH;
|
|
807
808
|
case 10:
|
|
808
809
|
case "RESOLVE_REASON_FLAG_NOT_FOUND": return ResolveReason.RESOLVE_REASON_FLAG_NOT_FOUND;
|
|
810
|
+
case 11:
|
|
811
|
+
case "RESOLVE_REASON_BUNDLE": return ResolveReason.RESOLVE_REASON_BUNDLE;
|
|
809
812
|
case -1:
|
|
810
813
|
case "UNRECOGNIZED":
|
|
811
814
|
default: return ResolveReason.UNRECOGNIZED;
|
|
@@ -824,6 +827,7 @@ function resolveReasonToJSON(object) {
|
|
|
824
827
|
case ResolveReason.RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED: return "RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED";
|
|
825
828
|
case ResolveReason.RESOLVE_REASON_TYPE_MISMATCH: return "RESOLVE_REASON_TYPE_MISMATCH";
|
|
826
829
|
case ResolveReason.RESOLVE_REASON_FLAG_NOT_FOUND: return "RESOLVE_REASON_FLAG_NOT_FOUND";
|
|
830
|
+
case ResolveReason.RESOLVE_REASON_BUNDLE: return "RESOLVE_REASON_BUNDLE";
|
|
827
831
|
case ResolveReason.UNRECOGNIZED:
|
|
828
832
|
default: return "UNRECOGNIZED";
|
|
829
833
|
}
|
|
@@ -1433,7 +1437,7 @@ function isObject(value) {
|
|
|
1433
1437
|
function isSet$3(value) {
|
|
1434
1438
|
return value !== null && value !== void 0;
|
|
1435
1439
|
}
|
|
1436
|
-
const VERSION = "0.15.
|
|
1440
|
+
const VERSION = "0.15.1";
|
|
1437
1441
|
const NOOP_LOG_FN = Object.assign(() => {}, { enabled: false });
|
|
1438
1442
|
const debugBackend = loadDebug();
|
|
1439
1443
|
const logger$2 = new class LoggerImpl {
|
|
@@ -2899,6 +2903,24 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
2899
2903
|
this.main.abort();
|
|
2900
2904
|
}
|
|
2901
2905
|
async resolve(context, flagNames, apply = false) {
|
|
2906
|
+
const startMs = performance.now();
|
|
2907
|
+
let reason = ResolveReason.RESOLVE_REASON_BUNDLE;
|
|
2908
|
+
try {
|
|
2909
|
+
return await this.resolveFlags(context, flagNames, apply);
|
|
2910
|
+
} catch (err) {
|
|
2911
|
+
reason = ResolveReason.RESOLVE_REASON_ERROR;
|
|
2912
|
+
return error(ErrorCode.GENERAL, String(err));
|
|
2913
|
+
} finally {
|
|
2914
|
+
const latencyUs = Math.round((performance.now() - startMs) * 1e3);
|
|
2915
|
+
try {
|
|
2916
|
+
this.resolver.registerResolve({
|
|
2917
|
+
reason,
|
|
2918
|
+
latencyUs
|
|
2919
|
+
});
|
|
2920
|
+
} catch {}
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
async resolveFlags(context, flagNames, apply) {
|
|
2902
2924
|
const resolveRequest = {
|
|
2903
2925
|
flags: flagNames.map((name) => `flags/${name}`),
|
|
2904
2926
|
evaluationContext: ConfidenceServerProviderLocal.convertEvaluationContext(context),
|
|
@@ -2909,12 +2931,8 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
2909
2931
|
version: VERSION
|
|
2910
2932
|
}
|
|
2911
2933
|
};
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
return create(await this.resolveProcess(processRequest));
|
|
2915
|
-
} catch (err) {
|
|
2916
|
-
return error(ErrorCode.GENERAL, String(err));
|
|
2917
|
-
}
|
|
2934
|
+
const processRequest = this.materializationStore ? { deferredMaterializations: resolveRequest } : { withoutMaterializations: resolveRequest };
|
|
2935
|
+
return create(await this.resolveProcess(processRequest));
|
|
2918
2936
|
}
|
|
2919
2937
|
async evaluate(flagKey, defaultValue, context) {
|
|
2920
2938
|
const startMs = performance.now();
|
|
@@ -2922,7 +2940,12 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
2922
2940
|
const [flagName] = flagKey.split(".", 1);
|
|
2923
2941
|
const { _confidence_skip_apply,...cleanContext } = context;
|
|
2924
2942
|
const skipApply = _confidence_skip_apply === true;
|
|
2925
|
-
|
|
2943
|
+
let resolution;
|
|
2944
|
+
try {
|
|
2945
|
+
resolution = await this.resolveFlags(cleanContext, [flagName], !skipApply);
|
|
2946
|
+
} catch (err) {
|
|
2947
|
+
resolution = error(ErrorCode.GENERAL, String(err));
|
|
2948
|
+
}
|
|
2926
2949
|
const result = resolve(resolution, flagKey, defaultValue, logger$1);
|
|
2927
2950
|
const latencyUs = Math.round((performance.now() - startMs) * 1e3);
|
|
2928
2951
|
let reason;
|