Skip to content

Commit e86d808

Browse files
committed
introduce evaluation context, deprecate old interfaces
1 parent e0c9881 commit e86d808

File tree

10 files changed

+1587
-227
lines changed

10 files changed

+1587
-227
lines changed

evaluation-context.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
export type EvaluationContext = {
2+
environment?: null | EnvironmentEvaluationContext;
3+
feature?: null | FeatureEvaluationContext;
4+
identity?: null | IdentityEvaluationContext;
5+
[property: string]: any;
6+
}
7+
8+
export type EnvironmentEvaluationContext = {
9+
api_key: string;
10+
[property: string]: any;
11+
}
12+
13+
export type FeatureEvaluationContext = {
14+
name: string;
15+
[property: string]: any;
16+
}
17+
18+
export type IdentityEvaluationContext = {
19+
identifier?: null | string;
20+
traits?: { [key: string]: null | TraitEvaluationContext };
21+
transient?: boolean | null;
22+
[property: string]: any;
23+
}
24+
25+
export type TraitEvaluationContext = {
26+
transient?: boolean;
27+
value: any;
28+
[property: string]: any;
29+
}

flagsmith-core.ts

Lines changed: 133 additions & 125 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)