@featurevisor/sdk 0.39.0 → 0.40.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 +19 -0
- package/README.md +13 -16
- package/coverage/clover.xml +2 -2
- package/coverage/lcov-report/bucket.ts.html +1 -1
- package/coverage/lcov-report/conditions.ts.html +1 -1
- package/coverage/lcov-report/datafileReader.ts.html +1 -1
- package/coverage/lcov-report/emitter.ts.html +1 -1
- package/coverage/lcov-report/feature.ts.html +1 -1
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/instance.ts.html +1 -1
- package/coverage/lcov-report/logger.ts.html +1 -1
- package/coverage/lcov-report/segments.ts.html +1 -1
- package/dist/index.js.gz +0 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.40.0](https://github.com/fahad19/featurevisor/compare/v0.39.2...v0.40.0) (2023-07-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @featurevisor/sdk
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.39.1](https://github.com/fahad19/featurevisor/compare/v0.39.0...v0.39.1) (2023-07-16)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* SDK README updates ([#106](https://github.com/fahad19/featurevisor/issues/106)) ([1c6ac53](https://github.com/fahad19/featurevisor/commit/1c6ac5311ac0d8df748cbb67e1e5b426038fee71))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [0.39.0](https://github.com/fahad19/featurevisor/compare/v0.38.0...v0.39.0) (2023-07-16)
|
|
7
26
|
|
|
8
27
|
|
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@ Visit [https://featurevisor.com/docs/sdks/](https://featurevisor.com/docs/sdks/)
|
|
|
23
23
|
- [`refreshInterval`](#refreshinterval)
|
|
24
24
|
- [`stickyFeatures`](#stickyfeatures)
|
|
25
25
|
- [API](#api)
|
|
26
|
+
- [`isEnabled`](#isenabled)
|
|
26
27
|
- [`getVariation`](#getvariation)
|
|
27
28
|
- [`getVariable`](#getvariable)
|
|
28
29
|
- [`activate`](#activate)
|
|
@@ -134,7 +135,10 @@ Pass set of initial features with their variation and (optional) variables that
|
|
|
134
135
|
const sdk = createInstance({
|
|
135
136
|
initialFeatures: {
|
|
136
137
|
myFeatureKey: {
|
|
137
|
-
|
|
138
|
+
enabled: true,
|
|
139
|
+
|
|
140
|
+
// optional
|
|
141
|
+
variation: "treatment",
|
|
138
142
|
variables: {
|
|
139
143
|
myVariableKey: "my-variable-value"
|
|
140
144
|
}
|
|
@@ -281,7 +285,10 @@ If a feature key is not present in this object, the SDK will continue to evaluat
|
|
|
281
285
|
const sdk = createInstance({
|
|
282
286
|
stickyFeatures: {
|
|
283
287
|
myFeatureKey: {
|
|
284
|
-
|
|
288
|
+
enabled: true,
|
|
289
|
+
|
|
290
|
+
// optional
|
|
291
|
+
variation: "treatment",
|
|
285
292
|
variables: {
|
|
286
293
|
myVariableKey: "my-variable-value"
|
|
287
294
|
}
|
|
@@ -294,16 +301,13 @@ const sdk = createInstance({
|
|
|
294
301
|
|
|
295
302
|
These methods are available once the SDK instance is created:
|
|
296
303
|
|
|
297
|
-
### `
|
|
304
|
+
### `isEnabled`
|
|
298
305
|
|
|
299
|
-
> `
|
|
306
|
+
> `isEnabled(featureKey: string, context: Context): boolean`
|
|
300
307
|
|
|
301
|
-
|
|
308
|
+
### `getVariation`
|
|
302
309
|
|
|
303
|
-
|
|
304
|
-
- `getVariationString`
|
|
305
|
-
- `getVariationInteger`
|
|
306
|
-
- `getVariationDouble`
|
|
310
|
+
> `getVariation(featureKey: string, context: Context): VariationValue`
|
|
307
311
|
|
|
308
312
|
### `getVariable`
|
|
309
313
|
|
|
@@ -327,13 +331,6 @@ Same as `getVariation`, but also calls the `onActivation` callback.
|
|
|
327
331
|
|
|
328
332
|
This is a convenience method meant to be called when you know the User has been exposed to your Feature, and you also want to track the activation.
|
|
329
333
|
|
|
330
|
-
Also supports additional type specific methods:
|
|
331
|
-
|
|
332
|
-
- `activateBoolean`
|
|
333
|
-
- `activateString`
|
|
334
|
-
- `activateInteger`
|
|
335
|
-
- `activateDouble`
|
|
336
|
-
|
|
337
334
|
### `isReady`
|
|
338
335
|
|
|
339
336
|
> `isReady(): boolean`
|
package/coverage/clover.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
2
|
+
<coverage generated="1689541057531" clover="3.2.0">
|
|
3
|
+
<project timestamp="1689541057531" name="All files">
|
|
4
4
|
<metrics statements="565" coveredstatements="331" conditionals="318" coveredconditionals="157" methods="94" coveredmethods="58" elements="977" coveredelements="546" complexity="0" loc="565" ncloc="565" packages="1" files="8" classes="8"/>
|
|
5
5
|
<file name="bucket.ts" path="/home/runner/work/featurevisor/featurevisor/packages/sdk/src/bucket.ts">
|
|
6
6
|
<metrics statements="8" coveredstatements="8" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
|
|
@@ -109,7 +109,7 @@ export function getBucketedNumber(bucketKey: string): number {
|
|
|
109
109
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
110
110
|
Code coverage generated by
|
|
111
111
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
112
|
-
at 2023-07-16T20:
|
|
112
|
+
at 2023-07-16T20:57:37.509Z
|
|
113
113
|
</div>
|
|
114
114
|
<script src="prettify.js"></script>
|
|
115
115
|
<script>
|
|
@@ -394,7 +394,7 @@ export function allConditionsAreMatched(
|
|
|
394
394
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
395
395
|
Code coverage generated by
|
|
396
396
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
397
|
-
at 2023-07-16T20:
|
|
397
|
+
at 2023-07-16T20:57:37.509Z
|
|
398
398
|
</div>
|
|
399
399
|
<script src="prettify.js"></script>
|
|
400
400
|
<script>
|
|
@@ -289,7 +289,7 @@ export class DatafileReader {
|
|
|
289
289
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
290
290
|
Code coverage generated by
|
|
291
291
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
292
|
-
at 2023-07-16T20:
|
|
292
|
+
at 2023-07-16T20:57:37.509Z
|
|
293
293
|
</div>
|
|
294
294
|
<script src="prettify.js"></script>
|
|
295
295
|
<script>
|
|
@@ -229,7 +229,7 @@ export class Emitter {
|
|
|
229
229
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
230
230
|
Code coverage generated by
|
|
231
231
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
232
|
-
at 2023-07-16T20:
|
|
232
|
+
at 2023-07-16T20:57:37.509Z
|
|
233
233
|
</div>
|
|
234
234
|
<script src="prettify.js"></script>
|
|
235
235
|
<script>
|
|
@@ -376,7 +376,7 @@ export function findForceFromFeature(
|
|
|
376
376
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
377
377
|
Code coverage generated by
|
|
378
378
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
379
|
-
at 2023-07-16T20:
|
|
379
|
+
at 2023-07-16T20:57:37.509Z
|
|
380
380
|
</div>
|
|
381
381
|
<script src="prettify.js"></script>
|
|
382
382
|
<script>
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
207
207
|
Code coverage generated by
|
|
208
208
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
209
|
-
at 2023-07-16T20:
|
|
209
|
+
at 2023-07-16T20:57:37.509Z
|
|
210
210
|
</div>
|
|
211
211
|
<script src="prettify.js"></script>
|
|
212
212
|
<script>
|
|
@@ -3682,7 +3682,7 @@ export function createInstance(options: InstanceOptions): FeaturevisorInstance {
|
|
|
3682
3682
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
3683
3683
|
Code coverage generated by
|
|
3684
3684
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
3685
|
-
at 2023-07-16T20:
|
|
3685
|
+
at 2023-07-16T20:57:37.509Z
|
|
3686
3686
|
</div>
|
|
3687
3687
|
<script src="prettify.js"></script>
|
|
3688
3688
|
<script>
|
|
@@ -328,7 +328,7 @@ export function createLogger(options: CreateLoggerOptions = {}): Logger {
|
|
|
328
328
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
329
329
|
Code coverage generated by
|
|
330
330
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
331
|
-
at 2023-07-16T20:
|
|
331
|
+
at 2023-07-16T20:57:37.509Z
|
|
332
332
|
</div>
|
|
333
333
|
<script src="prettify.js"></script>
|
|
334
334
|
<script>
|
|
@@ -238,7 +238,7 @@ export function allGroupSegmentsAreMatched(
|
|
|
238
238
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
239
239
|
Code coverage generated by
|
|
240
240
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
241
|
-
at 2023-07-16T20:
|
|
241
|
+
at 2023-07-16T20:57:37.509Z
|
|
242
242
|
</div>
|
|
243
243
|
<script src="prettify.js"></script>
|
|
244
244
|
<script>
|
package/dist/index.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@featurevisor/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "Featurevisor SDK for Node.js and the browser",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"license": "MIT",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@featurevisor/types": "^0.
|
|
45
|
+
"@featurevisor/types": "^0.40.0",
|
|
46
46
|
"compare-versions": "^6.0.0-rc.1",
|
|
47
47
|
"murmurhash": "^2.0.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "7915a3f4f1429e5da4ef0da076da02d4d3c24776"
|
|
50
50
|
}
|