@featurevisor/sdk 0.38.0 → 0.39.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 +22 -0
- package/README.md +13 -16
- package/coverage/clover.xml +91 -99
- package/coverage/coverage-final.json +1 -1
- 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 +19 -19
- package/coverage/lcov-report/instance.ts.html +10 -82
- package/coverage/lcov-report/logger.ts.html +1 -1
- package/coverage/lcov-report/segments.ts.html +1 -1
- package/coverage/lcov.info +158 -178
- package/dist/index.js +1 -1
- package/dist/index.js.gz +0 -0
- package/dist/index.js.map +1 -1
- package/lib/instance.d.ts +0 -4
- package/lib/instance.js +0 -20
- package/lib/instance.js.map +1 -1
- package/package.json +3 -3
- package/src/instance.ts +0 -24
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.39.1](https://github.com/fahad19/featurevisor/compare/v0.39.0...v0.39.1) (2023-07-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* SDK README updates ([#106](https://github.com/fahad19/featurevisor/issues/106)) ([1c6ac53](https://github.com/fahad19/featurevisor/commit/1c6ac5311ac0d8df748cbb67e1e5b426038fee71))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [0.39.0](https://github.com/fahad19/featurevisor/compare/v0.38.0...v0.39.0) (2023-07-16)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* drop type specific activate methods ([#105](https://github.com/fahad19/featurevisor/issues/105)) ([5faca24](https://github.com/fahad19/featurevisor/commit/5faca24e29665a03919ebf467bfb6a9c70c8e648))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
# [0.38.0](https://github.com/fahad19/featurevisor/compare/v0.37.1...v0.38.0) (2023-07-16)
|
|
7
29
|
|
|
8
30
|
|
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,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
4
|
-
<metrics statements="
|
|
2
|
+
<coverage generated="1689539060494" clover="3.2.0">
|
|
3
|
+
<project timestamp="1689539060494" name="All files">
|
|
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"/>
|
|
7
7
|
<line num="1" count="2" type="stmt"/>
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
<line num="100" count="0" type="stmt"/>
|
|
164
164
|
</file>
|
|
165
165
|
<file name="instance.ts" path="/home/runner/work/featurevisor/featurevisor/packages/sdk/src/instance.ts">
|
|
166
|
-
<metrics statements="
|
|
166
|
+
<metrics statements="373" coveredstatements="196" conditionals="199" coveredconditionals="76" methods="47" coveredmethods="25"/>
|
|
167
167
|
<line num="22" count="1" type="stmt"/>
|
|
168
168
|
<line num="23" count="1" type="stmt"/>
|
|
169
169
|
<line num="24" count="1" type="stmt"/>
|
|
@@ -441,110 +441,102 @@
|
|
|
441
441
|
<line num="847" count="1" type="stmt"/>
|
|
442
442
|
<line num="849" count="0" type="stmt"/>
|
|
443
443
|
<line num="851" count="0" type="stmt"/>
|
|
444
|
-
<line num="
|
|
445
|
-
<line num="
|
|
446
|
-
<line num="862" count="0" type="stmt"/>
|
|
447
|
-
<line num="864" count="0" type="stmt"/>
|
|
444
|
+
<line num="865" count="0" type="stmt"/>
|
|
445
|
+
<line num="866" count="0" type="cond" truecount="0" falsecount="2"/>
|
|
448
446
|
<line num="868" count="0" type="stmt"/>
|
|
449
|
-
<line num="870" count="0" type="
|
|
450
|
-
<line num="
|
|
447
|
+
<line num="870" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
448
|
+
<line num="871" count="0" type="stmt"/>
|
|
451
449
|
<line num="876" count="0" type="stmt"/>
|
|
450
|
+
<line num="878" count="0" type="stmt"/>
|
|
451
|
+
<line num="882" count="0" type="cond" truecount="0" falsecount="3"/>
|
|
452
|
+
<line num="883" count="0" type="stmt"/>
|
|
453
|
+
<line num="885" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
454
|
+
<line num="886" count="0" type="stmt"/>
|
|
455
|
+
<line num="888" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
452
456
|
<line num="889" count="0" type="stmt"/>
|
|
453
|
-
<line num="
|
|
454
|
-
<line num="
|
|
455
|
-
<line num="
|
|
456
|
-
<line num="895" count="0" type="stmt"/>
|
|
457
|
-
<line num="900" count="0" type="stmt"/>
|
|
458
|
-
<line num="902" count="0" type="stmt"/>
|
|
459
|
-
<line num="906" count="0" type="cond" truecount="0" falsecount="3"/>
|
|
460
|
-
<line num="907" count="0" type="stmt"/>
|
|
461
|
-
<line num="909" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
457
|
+
<line num="896" count="0" type="stmt"/>
|
|
458
|
+
<line num="898" count="0" type="stmt"/>
|
|
459
|
+
<line num="904" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
462
460
|
<line num="910" count="0" type="stmt"/>
|
|
463
461
|
<line num="912" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
464
|
-
<line num="913" count="0" type="
|
|
465
|
-
<line num="
|
|
466
|
-
<line num="
|
|
467
|
-
<line num="
|
|
468
|
-
<line num="
|
|
469
|
-
<line num="
|
|
470
|
-
<line num="
|
|
462
|
+
<line num="913" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
463
|
+
<line num="914" count="0" type="stmt"/>
|
|
464
|
+
<line num="921" count="0" type="stmt"/>
|
|
465
|
+
<line num="923" count="0" type="stmt"/>
|
|
466
|
+
<line num="928" count="0" type="stmt"/>
|
|
467
|
+
<line num="931" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
468
|
+
<line num="932" count="0" type="stmt"/>
|
|
471
469
|
<line num="938" count="0" type="stmt"/>
|
|
472
|
-
<line num="
|
|
473
|
-
<line num="
|
|
474
|
-
<line num="
|
|
475
|
-
<line num="
|
|
476
|
-
<line num="
|
|
477
|
-
<line num="
|
|
478
|
-
<line num="
|
|
479
|
-
<line num="
|
|
480
|
-
<line num="
|
|
481
|
-
<line num="
|
|
482
|
-
<line num="
|
|
483
|
-
<line num="
|
|
484
|
-
<line num="
|
|
485
|
-
<line num="
|
|
486
|
-
<line num="
|
|
487
|
-
<line num="
|
|
488
|
-
<line num="
|
|
489
|
-
<line num="
|
|
490
|
-
<line num="1000" count="0" type="stmt"/>
|
|
491
|
-
<line num="1004" count="0" type="stmt"/>
|
|
470
|
+
<line num="940" count="0" type="stmt"/>
|
|
471
|
+
<line num="943" count="0" type="cond" truecount="0" falsecount="2"/>
|
|
472
|
+
<line num="944" count="0" type="stmt"/>
|
|
473
|
+
<line num="948" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
474
|
+
<line num="949" count="0" type="stmt"/>
|
|
475
|
+
<line num="955" count="0" type="stmt"/>
|
|
476
|
+
<line num="957" count="0" type="stmt"/>
|
|
477
|
+
<line num="960" count="0" type="cond" truecount="0" falsecount="2"/>
|
|
478
|
+
<line num="963" count="0" type="stmt"/>
|
|
479
|
+
<line num="965" count="0" type="cond" truecount="0" falsecount="4"/>
|
|
480
|
+
<line num="966" count="0" type="stmt"/>
|
|
481
|
+
<line num="974" count="0" type="stmt"/>
|
|
482
|
+
<line num="976" count="0" type="stmt"/>
|
|
483
|
+
<line num="980" count="0" type="stmt"/>
|
|
484
|
+
<line num="982" count="0" type="stmt"/>
|
|
485
|
+
<line num="990" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
486
|
+
<line num="992" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
487
|
+
<line num="996" count="0" type="stmt"/>
|
|
492
488
|
<line num="1006" count="0" type="stmt"/>
|
|
493
|
-
<line num="
|
|
494
|
-
<line num="
|
|
489
|
+
<line num="1008" count="0" type="stmt"/>
|
|
490
|
+
<line num="1012" count="0" type="cond" truecount="0" falsecount="4"/>
|
|
491
|
+
<line num="1013" count="0" type="stmt"/>
|
|
492
|
+
<line num="1015" count="0" type="cond" truecount="0" falsecount="3"/>
|
|
493
|
+
<line num="1016" count="0" type="stmt"/>
|
|
494
|
+
<line num="1018" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
495
|
+
<line num="1019" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
495
496
|
<line num="1020" count="0" type="stmt"/>
|
|
496
|
-
<line num="
|
|
497
|
-
<line num="
|
|
498
|
-
<line num="
|
|
499
|
-
<line num="
|
|
500
|
-
<line num="
|
|
501
|
-
<line num="
|
|
502
|
-
<line num="1042" count="0" type="
|
|
503
|
-
<line num="
|
|
504
|
-
<line num="
|
|
505
|
-
<line num="
|
|
506
|
-
<line num="
|
|
507
|
-
<line num="
|
|
508
|
-
<line num="
|
|
509
|
-
<line num="
|
|
510
|
-
<line num="
|
|
511
|
-
<line num="
|
|
512
|
-
<line num="
|
|
513
|
-
<line num="
|
|
514
|
-
<line num="
|
|
515
|
-
<line num="
|
|
516
|
-
<line num="
|
|
517
|
-
<line num="
|
|
518
|
-
<line num="
|
|
519
|
-
<line num="
|
|
520
|
-
<line num="1114" count="0" type="stmt"/>
|
|
521
|
-
<line num="1116" count="0" type="stmt"/>
|
|
497
|
+
<line num="1021" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
498
|
+
<line num="1022" count="0" type="stmt"/>
|
|
499
|
+
<line num="1028" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
500
|
+
<line num="1029" count="0" type="stmt"/>
|
|
501
|
+
<line num="1038" count="0" type="stmt"/>
|
|
502
|
+
<line num="1041" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
503
|
+
<line num="1042" count="0" type="stmt"/>
|
|
504
|
+
<line num="1052" count="0" type="stmt"/>
|
|
505
|
+
<line num="1054" count="0" type="stmt"/>
|
|
506
|
+
<line num="1058" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
507
|
+
<line num="1059" count="0" type="stmt"/>
|
|
508
|
+
<line num="1069" count="0" type="stmt"/>
|
|
509
|
+
<line num="1071" count="0" type="stmt"/>
|
|
510
|
+
<line num="1079" count="0" type="stmt"/>
|
|
511
|
+
<line num="1088" count="0" type="stmt"/>
|
|
512
|
+
<line num="1090" count="0" type="stmt"/>
|
|
513
|
+
<line num="1092" count="0" type="stmt"/>
|
|
514
|
+
<line num="1099" count="0" type="stmt"/>
|
|
515
|
+
<line num="1108" count="0" type="stmt"/>
|
|
516
|
+
<line num="1109" count="0" type="stmt"/>
|
|
517
|
+
<line num="1111" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
518
|
+
<line num="1112" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
519
|
+
<line num="1117" count="0" type="stmt"/>
|
|
520
|
+
<line num="1120" count="0" type="stmt"/>
|
|
522
521
|
<line num="1123" count="0" type="stmt"/>
|
|
523
|
-
<line num="
|
|
524
|
-
<line num="
|
|
525
|
-
<line num="
|
|
526
|
-
<line num="
|
|
527
|
-
<line num="
|
|
528
|
-
<line num="
|
|
529
|
-
<line num="
|
|
530
|
-
<line num="
|
|
531
|
-
<line num="
|
|
532
|
-
<line num="
|
|
533
|
-
<line num="
|
|
534
|
-
<line num="
|
|
535
|
-
<line num="
|
|
536
|
-
<line num="
|
|
537
|
-
<line num="
|
|
538
|
-
<line num="
|
|
539
|
-
<line num="
|
|
540
|
-
<line num="
|
|
541
|
-
<line num="1202" count="0" type="stmt"/>
|
|
542
|
-
<line num="1210" count="0" type="stmt"/>
|
|
543
|
-
<line num="1212" count="0" type="stmt"/>
|
|
544
|
-
<line num="1220" count="0" type="stmt"/>
|
|
545
|
-
<line num="1222" count="0" type="stmt"/>
|
|
546
|
-
<line num="1226" count="1" type="stmt"/>
|
|
547
|
-
<line num="1227" count="10" type="stmt"/>
|
|
522
|
+
<line num="1125" count="0" type="stmt"/>
|
|
523
|
+
<line num="1127" count="0" type="stmt"/>
|
|
524
|
+
<line num="1136" count="0" type="stmt"/>
|
|
525
|
+
<line num="1138" count="0" type="stmt"/>
|
|
526
|
+
<line num="1146" count="0" type="stmt"/>
|
|
527
|
+
<line num="1148" count="0" type="stmt"/>
|
|
528
|
+
<line num="1156" count="0" type="stmt"/>
|
|
529
|
+
<line num="1158" count="0" type="stmt"/>
|
|
530
|
+
<line num="1166" count="0" type="stmt"/>
|
|
531
|
+
<line num="1168" count="0" type="stmt"/>
|
|
532
|
+
<line num="1176" count="0" type="stmt"/>
|
|
533
|
+
<line num="1178" count="0" type="stmt"/>
|
|
534
|
+
<line num="1186" count="0" type="stmt"/>
|
|
535
|
+
<line num="1188" count="0" type="stmt"/>
|
|
536
|
+
<line num="1196" count="0" type="stmt"/>
|
|
537
|
+
<line num="1198" count="0" type="stmt"/>
|
|
538
|
+
<line num="1202" count="1" type="stmt"/>
|
|
539
|
+
<line num="1203" count="10" type="stmt"/>
|
|
548
540
|
</file>
|
|
549
541
|
<file name="logger.ts" path="/home/runner/work/featurevisor/featurevisor/packages/sdk/src/logger.ts">
|
|
550
542
|
<metrics statements="22" coveredstatements="13" conditionals="11" coveredconditionals="5" methods="9" coveredmethods="5"/>
|