@featurevisor/types 0.15.0 → 0.16.0

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 CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.16.0](https://github.com/fahad19/featurevisor/compare/v0.15.0...v0.16.0) (2023-04-30)
7
+
8
+
9
+ ### Features
10
+
11
+ * Mutually exclusive experiments via Groups ([#63](https://github.com/fahad19/featurevisor/issues/63)) ([f3c8523](https://github.com/fahad19/featurevisor/commit/f3c85236d36fd0e499897f9ce1c2ed551c111523))
12
+
13
+
14
+
15
+
16
+
6
17
  # [0.15.0](https://github.com/fahad19/featurevisor/compare/v0.14.1...v0.15.0) (2023-04-23)
7
18
 
8
19
  **Note:** Version bump only for package @featurevisor/types
package/lib/index.d.ts CHANGED
@@ -93,15 +93,29 @@ export interface Force {
93
93
  [key: string]: VariableValue;
94
94
  };
95
95
  }
96
+ export interface Slot {
97
+ feature: FeatureKey | false;
98
+ percentage: Weight;
99
+ }
100
+ export interface Group {
101
+ key: string;
102
+ description: string;
103
+ slots: Slot[];
104
+ }
96
105
  export type BucketKey = string;
97
106
  export type BucketValue = number;
98
107
  /**
99
108
  * Datafile-only types
100
109
  */
101
110
  export type Percentage = number;
111
+ export interface Range {
112
+ start: Percentage;
113
+ end: Percentage;
114
+ }
102
115
  export interface Allocation {
103
116
  variation: VariationValue;
104
- percentage: Percentage;
117
+ percentage?: Percentage;
118
+ range: Range;
105
119
  }
106
120
  export interface Traffic {
107
121
  key: RuleKey;
@@ -178,6 +192,7 @@ export interface ExistingFeature {
178
192
  percentage: Percentage;
179
193
  allocation: Allocation[];
180
194
  }[];
195
+ ranges?: Range[];
181
196
  }
182
197
  export interface ExistingFeatures {
183
198
  [key: FeatureKey]: ExistingFeature;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@featurevisor/types",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Common Typescript types for Featurevisor",
5
5
  "main": "dist/index.js",
6
6
  "module": "lib/index.js",
@@ -41,5 +41,5 @@
41
41
  "url": "https://github.com/fahad19/featurevisor/issues"
42
42
  },
43
43
  "license": "MIT",
44
- "gitHead": "254d79ee3bcbd5d9c2f771f66e653ffe5512176e"
44
+ "gitHead": "7e9b87c4653e4f2940fb399a53e919a2c7450c14"
45
45
  }
package/src/index.ts CHANGED
@@ -176,6 +176,17 @@ export interface Force {
176
176
  };
177
177
  }
178
178
 
179
+ export interface Slot {
180
+ feature: FeatureKey | false;
181
+ percentage: Weight; // 0 to 100
182
+ }
183
+
184
+ export interface Group {
185
+ key: string;
186
+ description: string;
187
+ slots: Slot[];
188
+ }
189
+
179
190
  export type BucketKey = string;
180
191
  export type BucketValue = number; // 0 to 100,000 (100% * 1000 to include three decimal places in same integer)
181
192
 
@@ -184,9 +195,15 @@ export type BucketValue = number; // 0 to 100,000 (100% * 1000 to include three
184
195
  */
185
196
  export type Percentage = number; // 0 to 100,000 (100% * 1000 to include three decimal places in same integer)
186
197
 
198
+ export interface Range {
199
+ start: Percentage; // 0 to 100k
200
+ end: Percentage; // 0 to 100k
201
+ }
202
+
187
203
  export interface Allocation {
188
204
  variation: VariationValue;
189
- percentage: Percentage;
205
+ percentage?: Percentage; // @TODO: remove it in next breaking semver
206
+ range: Range; // @TODO: in future, turn it into `ranges`, so that Allocations with same variation do not repeat
190
207
  }
191
208
 
192
209
  export interface Traffic {
@@ -281,6 +298,7 @@ export interface ExistingFeature {
281
298
  percentage: Percentage;
282
299
  allocation: Allocation[];
283
300
  }[];
301
+ ranges?: Range[]; // if in a Group, these are the available slot ranges
284
302
  }
285
303
 
286
304
  export interface ExistingFeatures {