@splitsoftware/splitio 10.22.4 → 10.22.5
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/CHANGES.txt +25 -19
- package/README.md +7 -6
- package/es/index.js +0 -15
- package/es/settings/defaults/version.js +1 -1
- package/es/sync/offline/splitsParserFromFile.js +27 -26
- package/lib/index.js +0 -15
- package/lib/settings/defaults/version.js +1 -1
- package/lib/sync/offline/splitsParserFromFile.js +27 -26
- package/package.json +7 -2
- package/src/index.js +0 -16
- package/src/platform/EventEmitter.js +95 -95
- package/src/settings/defaults/version.js +1 -1
- package/src/sync/offline/splitsParserFromFile.js +27 -26
- package/types/client/index.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/types/server/index.d.ts +1 -1
- package/types/splitio.d.ts +96 -93
package/types/splitio.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for
|
|
1
|
+
// Type definitions for JavaScript and NodeJS Split Software SDK
|
|
2
2
|
// Project: http://www.split.io/
|
|
3
3
|
// Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
|
|
4
4
|
|
|
@@ -214,24 +214,24 @@ interface ISharedSettings {
|
|
|
214
214
|
*/
|
|
215
215
|
sync?: {
|
|
216
216
|
/**
|
|
217
|
-
* List of
|
|
217
|
+
* List of feature flag filters. These filters are used to fetch a subset of the feature flag definitions in your environment, in order to reduce the delay of the SDK to be ready.
|
|
218
218
|
* This configuration is only meaningful when the SDK is working in "standalone" mode.
|
|
219
219
|
*
|
|
220
|
-
* At the moment,
|
|
220
|
+
* At the moment, only one type of feature flag filter is supported: by name.
|
|
221
|
+
*
|
|
221
222
|
* Example:
|
|
222
223
|
* `splitFilter: [
|
|
223
|
-
* { type: 'byName', values: ['
|
|
224
|
-
* { type: 'byPrefix', values: ['testing'] } // will fetch splits whose names start with 'testing__' prefix
|
|
224
|
+
* { type: 'byName', values: ['my_feature_flag_1', 'my_feature_flag_2'] }, // will fetch feature flags named 'my_feature_flag_1' and 'my_feature_flag_2'
|
|
225
225
|
* ]`
|
|
226
226
|
* @property {SplitIO.SplitFilter[]} splitFilters
|
|
227
227
|
*/
|
|
228
228
|
splitFilters?: SplitIO.SplitFilter[]
|
|
229
229
|
/**
|
|
230
|
-
* Impressions Collection Mode. Option to determine how impressions are going to be sent to Split
|
|
230
|
+
* Impressions Collection Mode. Option to determine how impressions are going to be sent to Split servers.
|
|
231
231
|
* Possible values are 'DEBUG', 'OPTIMIZED', and 'NONE'.
|
|
232
232
|
* - DEBUG: will send all the impressions generated (recommended only for debugging purposes).
|
|
233
|
-
* - OPTIMIZED: will send unique impressions to Split
|
|
234
|
-
* - NONE: will send unique keys evaluated per feature to Split
|
|
233
|
+
* - OPTIMIZED: will send unique impressions to Split servers, avoiding a considerable amount of traffic that duplicated impressions could generate.
|
|
234
|
+
* - NONE: will send unique keys evaluated per feature to Split servers instead of full blown impressions, avoiding a considerable amount of traffic that impressions could generate.
|
|
235
235
|
*
|
|
236
236
|
* @property {string} impressionsMode
|
|
237
237
|
* @default 'OPTIMIZED'
|
|
@@ -293,7 +293,7 @@ interface INodeBasicSettings extends ISharedSettings {
|
|
|
293
293
|
*/
|
|
294
294
|
scheduler?: {
|
|
295
295
|
/**
|
|
296
|
-
* The SDK polls Split servers for changes to feature
|
|
296
|
+
* The SDK polls Split servers for changes to feature flag definitions. This parameter controls this polling period in seconds.
|
|
297
297
|
* @property {number} featuresRefreshRate
|
|
298
298
|
* @default 60
|
|
299
299
|
*/
|
|
@@ -364,7 +364,7 @@ interface INodeBasicSettings extends ISharedSettings {
|
|
|
364
364
|
*/
|
|
365
365
|
core: {
|
|
366
366
|
/**
|
|
367
|
-
* Your
|
|
367
|
+
* Your SDK key. More information: @see {@link https://help.split.io/hc/en-us/articles/360019916211-API-keys}
|
|
368
368
|
* @property {string} authorizationKey
|
|
369
369
|
*/
|
|
370
370
|
authorizationKey: string,
|
|
@@ -389,7 +389,7 @@ interface INodeBasicSettings extends ISharedSettings {
|
|
|
389
389
|
/**
|
|
390
390
|
* Storage type to be instantiated by the SDK.
|
|
391
391
|
* @property {StorageType} type
|
|
392
|
-
* @default MEMORY
|
|
392
|
+
* @default 'MEMORY'
|
|
393
393
|
*/
|
|
394
394
|
type?: StorageType,
|
|
395
395
|
/**
|
|
@@ -400,7 +400,7 @@ interface INodeBasicSettings extends ISharedSettings {
|
|
|
400
400
|
/**
|
|
401
401
|
* Optional prefix to prevent any kind of data collision between SDK versions.
|
|
402
402
|
* @property {string} prefix
|
|
403
|
-
* @default SPLITIO
|
|
403
|
+
* @default 'SPLITIO'
|
|
404
404
|
*/
|
|
405
405
|
prefix?: string
|
|
406
406
|
},
|
|
@@ -408,14 +408,14 @@ interface INodeBasicSettings extends ISharedSettings {
|
|
|
408
408
|
* The SDK mode. Possible values are "standalone", which is the default when using a synchronous storage, like 'MEMORY' and 'LOCALSTORAGE',
|
|
409
409
|
* and "consumer", which must be set when using an asynchronous storage, like 'REDIS'. For "localhost" mode, use "localhost" as authorizationKey.
|
|
410
410
|
* @property {SDKMode} mode
|
|
411
|
-
* @default standalone
|
|
411
|
+
* @default 'standalone'
|
|
412
412
|
*/
|
|
413
413
|
mode?: SDKMode,
|
|
414
414
|
/**
|
|
415
415
|
* Mocked features file path. For testing purposses only. For using this you should specify "localhost" as authorizationKey on core settings.
|
|
416
416
|
* @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#localhost-mode}
|
|
417
417
|
* @property {MockedFeaturesFilePath} features
|
|
418
|
-
* @default $HOME/.split
|
|
418
|
+
* @default '$HOME/.split'
|
|
419
419
|
*/
|
|
420
420
|
features?: SplitIO.MockedFeaturesFilePath,
|
|
421
421
|
}
|
|
@@ -431,7 +431,7 @@ interface IStatusInterface extends EventEmitter {
|
|
|
431
431
|
*/
|
|
432
432
|
Event: EventConsts,
|
|
433
433
|
/**
|
|
434
|
-
* Returns a promise that
|
|
434
|
+
* Returns a promise that resolves once the SDK has finished loading (SDK_READY event emitted) or rejected if the SDK has timedout (SDK_READY_TIMED_OUT event emitted).
|
|
435
435
|
* As it's meant to provide similar flexibility to the event approach, given that the SDK might be eventually ready after a timeout event, calling the `ready` method after the
|
|
436
436
|
* SDK had timed out will return a new promise that should eventually resolve if the SDK gets ready.
|
|
437
437
|
*
|
|
@@ -463,7 +463,7 @@ interface IBasicClient extends IStatusInterface {
|
|
|
463
463
|
* In 'consumer' mode, this method will disconnect the SDK from the Redis or Pluggable storage.
|
|
464
464
|
*
|
|
465
465
|
* @function destroy
|
|
466
|
-
* @returns {Promise<void>} A promise that
|
|
466
|
+
* @returns {Promise<void>} A promise that resolves once the client is destroyed.
|
|
467
467
|
*/
|
|
468
468
|
destroy(): Promise<void>
|
|
469
469
|
}
|
|
@@ -491,17 +491,17 @@ interface IBasicSDK {
|
|
|
491
491
|
*/
|
|
492
492
|
declare namespace SplitIO {
|
|
493
493
|
/**
|
|
494
|
-
*
|
|
494
|
+
* Feature flag treatment value, returned by getTreatment.
|
|
495
495
|
* @typedef {string} Treatment
|
|
496
496
|
*/
|
|
497
497
|
type Treatment = string;
|
|
498
498
|
/**
|
|
499
|
-
*
|
|
499
|
+
* Feature flag treatment promise that resolves to actual treatment value.
|
|
500
500
|
* @typedef {Promise<string>} AsyncTreatment
|
|
501
501
|
*/
|
|
502
502
|
type AsyncTreatment = Promise<string>;
|
|
503
503
|
/**
|
|
504
|
-
* An object with the treatments for a bulk of
|
|
504
|
+
* An object with the treatments for a bulk of feature flags, returned by getTreatments. For example:
|
|
505
505
|
* {
|
|
506
506
|
* feature1: 'on',
|
|
507
507
|
* feature2: 'off
|
|
@@ -512,14 +512,14 @@ declare namespace SplitIO {
|
|
|
512
512
|
[featureName: string]: Treatment
|
|
513
513
|
};
|
|
514
514
|
/**
|
|
515
|
-
*
|
|
515
|
+
* Feature flag treatments promise that resolves to the actual SplitIO.Treatments object.
|
|
516
516
|
* @typedef {Promise<Treatments>} AsyncTreatments
|
|
517
517
|
*/
|
|
518
518
|
type AsyncTreatments = Promise<Treatments>;
|
|
519
519
|
/**
|
|
520
|
-
*
|
|
520
|
+
* Feature flag evaluation result with treatment and configuration, returned by getTreatmentWithConfig.
|
|
521
521
|
* @typedef {Object} TreatmentWithConfig
|
|
522
|
-
* @property {string} treatment The treatment
|
|
522
|
+
* @property {string} treatment The treatment string
|
|
523
523
|
* @property {string | null} config The stringified version of the JSON config defined for that treatment, null if there is no config for the resulting treatment.
|
|
524
524
|
*/
|
|
525
525
|
type TreatmentWithConfig = {
|
|
@@ -527,13 +527,13 @@ declare namespace SplitIO {
|
|
|
527
527
|
config: string | null
|
|
528
528
|
};
|
|
529
529
|
/**
|
|
530
|
-
*
|
|
530
|
+
* Feature flag treatment promise that resolves to actual treatment with config value.
|
|
531
531
|
* @typedef {Promise<TreatmentWithConfig>} AsyncTreatmentWithConfig
|
|
532
532
|
*/
|
|
533
533
|
type AsyncTreatmentWithConfig = Promise<TreatmentWithConfig>;
|
|
534
534
|
/**
|
|
535
|
-
* An object with the treatments with configs for a bulk of
|
|
536
|
-
* Each existing configuration is a stringified version of the JSON you defined on the Split
|
|
535
|
+
* An object with the treatments with configs for a bulk of feature flags, returned by getTreatmentsWithConfig.
|
|
536
|
+
* Each existing configuration is a stringified version of the JSON you defined on the Split user interface. For example:
|
|
537
537
|
* {
|
|
538
538
|
* feature1: { treatment: 'on', config: null }
|
|
539
539
|
* feature2: { treatment: 'off', config: '{"bannerText":"Click here."}' }
|
|
@@ -544,7 +544,7 @@ declare namespace SplitIO {
|
|
|
544
544
|
[featureName: string]: TreatmentWithConfig
|
|
545
545
|
};
|
|
546
546
|
/**
|
|
547
|
-
*
|
|
547
|
+
* Feature flag treatments promise that resolves to the actual SplitIO.TreatmentsWithConfig object.
|
|
548
548
|
* @typedef {Promise<TreatmentsWithConfig>} AsyncTreatmentsWithConfig
|
|
549
549
|
*/
|
|
550
550
|
type AsyncTreatmentsWithConfig = Promise<TreatmentsWithConfig>;
|
|
@@ -554,7 +554,7 @@ declare namespace SplitIO {
|
|
|
554
554
|
*/
|
|
555
555
|
type Event = 'init::timeout' | 'init::ready' | 'init::cache-ready' | 'state::update';
|
|
556
556
|
/**
|
|
557
|
-
*
|
|
557
|
+
* Attributes should be on object with values of type string, boolean, number (dates should be sent as millis since epoch) or array of strings or numbers.
|
|
558
558
|
* @typedef {Object.<AttributeType>} Attributes
|
|
559
559
|
* @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#attribute-syntax}
|
|
560
560
|
*/
|
|
@@ -567,7 +567,7 @@ declare namespace SplitIO {
|
|
|
567
567
|
*/
|
|
568
568
|
type AttributeType = string | number | boolean | Array<string | number>;
|
|
569
569
|
/**
|
|
570
|
-
*
|
|
570
|
+
* Properties should be an object with values of type string, number, boolean or null. Size limit of ~31kb.
|
|
571
571
|
* @typedef {Object.<number, string, boolean, null>} Properties
|
|
572
572
|
* @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#track
|
|
573
573
|
*/
|
|
@@ -621,38 +621,38 @@ declare namespace SplitIO {
|
|
|
621
621
|
sdkLanguageVersion: string
|
|
622
622
|
};
|
|
623
623
|
/**
|
|
624
|
-
* Data corresponding to one
|
|
624
|
+
* Data corresponding to one feature flag view.
|
|
625
625
|
* @typedef {Object} SplitView
|
|
626
626
|
*/
|
|
627
627
|
type SplitView = {
|
|
628
628
|
/**
|
|
629
|
-
* The name of the
|
|
629
|
+
* The name of the feature flag.
|
|
630
630
|
* @property {string} name
|
|
631
631
|
*/
|
|
632
632
|
name: string,
|
|
633
633
|
/**
|
|
634
|
-
* The traffic type of the
|
|
634
|
+
* The traffic type of the feature flag.
|
|
635
635
|
* @property {string} trafficType
|
|
636
636
|
*/
|
|
637
637
|
trafficType: string,
|
|
638
638
|
/**
|
|
639
|
-
* Whether the
|
|
639
|
+
* Whether the feature flag is killed or not.
|
|
640
640
|
* @property {boolean} killed
|
|
641
641
|
*/
|
|
642
642
|
killed: boolean,
|
|
643
643
|
/**
|
|
644
|
-
* The list of treatments available for the
|
|
644
|
+
* The list of treatments available for the feature flag.
|
|
645
645
|
* @property {Array<string>} treatments
|
|
646
646
|
*/
|
|
647
647
|
treatments: Array<string>,
|
|
648
648
|
/**
|
|
649
|
-
* Current change number of the
|
|
649
|
+
* Current change number of the feature flag.
|
|
650
650
|
* @property {number} changeNumber
|
|
651
651
|
*/
|
|
652
652
|
changeNumber: number,
|
|
653
653
|
/**
|
|
654
654
|
* Map of configurations per treatment.
|
|
655
|
-
* Each existing configuration is a stringified version of the JSON you defined on the Split
|
|
655
|
+
* Each existing configuration is a stringified version of the JSON you defined on the Split user interface.
|
|
656
656
|
* @property {Object.<string>} configs
|
|
657
657
|
*/
|
|
658
658
|
configs: {
|
|
@@ -660,7 +660,7 @@ declare namespace SplitIO {
|
|
|
660
660
|
}
|
|
661
661
|
};
|
|
662
662
|
/**
|
|
663
|
-
* A promise that
|
|
663
|
+
* A promise that resolves to a feature flag view.
|
|
664
664
|
* @typedef {Promise<SplitView>} SplitView
|
|
665
665
|
*/
|
|
666
666
|
type SplitViewAsync = Promise<SplitView>;
|
|
@@ -669,17 +669,17 @@ declare namespace SplitIO {
|
|
|
669
669
|
*/
|
|
670
670
|
type SplitViews = Array<SplitView>;
|
|
671
671
|
/**
|
|
672
|
-
* A promise that
|
|
672
|
+
* A promise that resolves to an SplitIO.SplitViews array.
|
|
673
673
|
* @typedef {Promise<SplitViews>} SplitViewsAsync
|
|
674
674
|
*/
|
|
675
675
|
type SplitViewsAsync = Promise<SplitViews>;
|
|
676
676
|
/**
|
|
677
|
-
* An array of
|
|
677
|
+
* An array of feature flag names.
|
|
678
678
|
* @typedef {Array<string>} SplitNames
|
|
679
679
|
*/
|
|
680
680
|
type SplitNames = Array<string>;
|
|
681
681
|
/**
|
|
682
|
-
* A promise that
|
|
682
|
+
* A promise that resolves to an array of feature flag names.
|
|
683
683
|
* @typedef {Promise<SplitNames>} SplitNamesAsync
|
|
684
684
|
*/
|
|
685
685
|
type SplitNamesAsync = Promise<SplitNames>;
|
|
@@ -860,7 +860,7 @@ declare namespace SplitIO {
|
|
|
860
860
|
*/
|
|
861
861
|
type UrlSettings = {
|
|
862
862
|
/**
|
|
863
|
-
* String property to override the base URL where the SDK will get
|
|
863
|
+
* String property to override the base URL where the SDK will get rollout plan related data, like feature flags and segments definitions.
|
|
864
864
|
* @property {string} sdk
|
|
865
865
|
* @default 'https://sdk.split.io/api'
|
|
866
866
|
*/
|
|
@@ -897,20 +897,23 @@ declare namespace SplitIO {
|
|
|
897
897
|
type BrowserIntegration = ISplitToGoogleAnalyticsConfig | IGoogleAnalyticsToSplitConfig;
|
|
898
898
|
/**
|
|
899
899
|
* SplitFilter type.
|
|
900
|
+
*
|
|
900
901
|
* @typedef {string} SplitFilterType
|
|
901
902
|
*/
|
|
902
903
|
type SplitFilterType = 'byName' | 'byPrefix';
|
|
903
904
|
/**
|
|
904
|
-
* Defines a
|
|
905
|
+
* Defines a feature flag filter, described by a type and list of values.
|
|
905
906
|
*/
|
|
906
907
|
interface SplitFilter {
|
|
907
908
|
/**
|
|
908
909
|
* Type of the filter.
|
|
910
|
+
*
|
|
909
911
|
* @property {SplitFilterType} type
|
|
910
912
|
*/
|
|
911
913
|
type: SplitFilterType,
|
|
912
914
|
/**
|
|
913
|
-
* List of values:
|
|
915
|
+
* List of values: feature flag names for 'byName' filter type, and feature flag name prefixes for 'byPrefix' type.
|
|
916
|
+
*
|
|
914
917
|
* @property {string[]} values
|
|
915
918
|
*/
|
|
916
919
|
values: string[],
|
|
@@ -970,7 +973,7 @@ declare namespace SplitIO {
|
|
|
970
973
|
*/
|
|
971
974
|
scheduler?: {
|
|
972
975
|
/**
|
|
973
|
-
* The SDK polls Split servers for changes to feature
|
|
976
|
+
* The SDK polls Split servers for changes to feature flag definitions. This parameter controls this polling period in seconds.
|
|
974
977
|
* @property {number} featuresRefreshRate
|
|
975
978
|
* @default 60
|
|
976
979
|
*/
|
|
@@ -1041,7 +1044,7 @@ declare namespace SplitIO {
|
|
|
1041
1044
|
*/
|
|
1042
1045
|
core: {
|
|
1043
1046
|
/**
|
|
1044
|
-
* Your
|
|
1047
|
+
* Your SDK key. More information: @see {@link https://help.split.io/hc/en-us/articles/360019916211-API-keys}
|
|
1045
1048
|
* @property {string} authorizationKey
|
|
1046
1049
|
*/
|
|
1047
1050
|
authorizationKey: string,
|
|
@@ -1077,13 +1080,13 @@ declare namespace SplitIO {
|
|
|
1077
1080
|
/**
|
|
1078
1081
|
* Storage type to be instantiated by the SDK.
|
|
1079
1082
|
* @property {BrowserStorage} type
|
|
1080
|
-
* @default MEMORY
|
|
1083
|
+
* @default 'MEMORY'
|
|
1081
1084
|
*/
|
|
1082
1085
|
type?: BrowserStorage,
|
|
1083
1086
|
/**
|
|
1084
1087
|
* Optional prefix to prevent any kind of data collision between SDK versions.
|
|
1085
1088
|
* @property {string} prefix
|
|
1086
|
-
* @default SPLITIO
|
|
1089
|
+
* @default 'SPLITIO'
|
|
1087
1090
|
*/
|
|
1088
1091
|
prefix?: string
|
|
1089
1092
|
},
|
|
@@ -1333,83 +1336,83 @@ declare namespace SplitIO {
|
|
|
1333
1336
|
* For usage on NodeJS as we don't have only one key.
|
|
1334
1337
|
* @function getTreatment
|
|
1335
1338
|
* @param {string} key - The string key representing the consumer.
|
|
1336
|
-
* @param {string}
|
|
1339
|
+
* @param {string} featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1337
1340
|
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
|
|
1338
1341
|
* @returns {Treatment} The treatment string.
|
|
1339
1342
|
*/
|
|
1340
|
-
getTreatment(key: SplitKey,
|
|
1343
|
+
getTreatment(key: SplitKey, featureFlagName: string, attributes?: Attributes): Treatment,
|
|
1341
1344
|
/**
|
|
1342
1345
|
* Returns a Treatment value, which is the treatment string for the given feature.
|
|
1343
1346
|
* For usage on the Browser as we defined the key on the settings.
|
|
1344
1347
|
* @function getTreatment
|
|
1345
|
-
* @param {string}
|
|
1348
|
+
* @param {string} featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1346
1349
|
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
|
|
1347
1350
|
* @returns {Treatment} The treatment string.
|
|
1348
1351
|
*/
|
|
1349
|
-
getTreatment(
|
|
1352
|
+
getTreatment(featureFlagName: string, attributes?: Attributes): Treatment,
|
|
1350
1353
|
/**
|
|
1351
1354
|
* Returns a TreatmentWithConfig value, which is an object with both treatment and config string for the given feature.
|
|
1352
1355
|
* For usage on NodeJS as we don't have only one key.
|
|
1353
1356
|
* @function getTreatmentWithConfig
|
|
1354
1357
|
* @param {string} key - The string key representing the consumer.
|
|
1355
|
-
* @param {string}
|
|
1358
|
+
* @param {string} featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1356
1359
|
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
|
|
1357
1360
|
* @returns {TreatmentWithConfig} The TreatmentWithConfig, the object containing the treatment string and the
|
|
1358
1361
|
* configuration stringified JSON (or null if there was no config for that treatment).
|
|
1359
1362
|
*/
|
|
1360
|
-
getTreatmentWithConfig(key: SplitKey,
|
|
1363
|
+
getTreatmentWithConfig(key: SplitKey, featureFlagName: string, attributes?: Attributes): TreatmentWithConfig,
|
|
1361
1364
|
/**
|
|
1362
1365
|
* Returns a TreatmentWithConfig value, which an object with both treatment and config string for the given feature.
|
|
1363
1366
|
* For usage on the Browser as we defined the key on the settings.
|
|
1364
1367
|
* @function getTreatment
|
|
1365
|
-
* @param {string}
|
|
1368
|
+
* @param {string} featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1366
1369
|
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
|
|
1367
1370
|
* @returns {TreatmentWithConfig} The TreatmentWithConfig, the object containing the treatment string and the
|
|
1368
1371
|
* configuration stringified JSON (or null if there was no config for that treatment).
|
|
1369
1372
|
*/
|
|
1370
|
-
getTreatmentWithConfig(
|
|
1373
|
+
getTreatmentWithConfig(featureFlagName: string, attributes?: Attributes): TreatmentWithConfig,
|
|
1371
1374
|
/**
|
|
1372
1375
|
* Returns a Treatments value, which is an object map with the treatments for the given features.
|
|
1373
1376
|
* For usage on NodeJS as we don't have only one key.
|
|
1374
1377
|
* NOTE: Treatment will be a promise only in async storages, like REDIS.
|
|
1375
1378
|
* @function getTreatments
|
|
1376
1379
|
* @param {string} key - The string key representing the consumer.
|
|
1377
|
-
* @param {Array<string>}
|
|
1380
|
+
* @param {Array<string>} featureFlagNames - An array of the feature flag names we want to get the treatments.
|
|
1378
1381
|
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
|
|
1379
1382
|
* @returns {Treatments} The treatments object map.
|
|
1380
1383
|
*/
|
|
1381
|
-
getTreatments(key: SplitKey,
|
|
1384
|
+
getTreatments(key: SplitKey, featureFlagNames: string[], attributes?: Attributes): Treatments,
|
|
1382
1385
|
/**
|
|
1383
1386
|
* Returns a Treatments value, which is an object map with the treatments for the given features.
|
|
1384
1387
|
* For usage on the Browser as we defined the key on the settings.
|
|
1385
1388
|
* NOTE: Treatment will be a promise only in async storages, like REDIS.
|
|
1386
1389
|
* @function getTreatments
|
|
1387
|
-
* @param {Array<string>}
|
|
1390
|
+
* @param {Array<string>} featureFlagNames - An array of the feature flags names we want to get the treatments.
|
|
1388
1391
|
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
|
|
1389
1392
|
* @returns {Treatments} The treatments object map.
|
|
1390
1393
|
*/
|
|
1391
|
-
getTreatments(
|
|
1394
|
+
getTreatments(featureFlagNames: string[], attributes?: Attributes): Treatments,
|
|
1392
1395
|
/**
|
|
1393
1396
|
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the given features.
|
|
1394
1397
|
* For usage on NodeJS as we don't have only one key.
|
|
1395
1398
|
* @function getTreatmentsWithConfig
|
|
1396
1399
|
* @param {string} key - The string key representing the consumer.
|
|
1397
|
-
* @param {Array<string>}
|
|
1400
|
+
* @param {Array<string>} featureFlagNames - An array of the feature flag names we want to get the treatments.
|
|
1398
1401
|
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
|
|
1399
1402
|
* @returns {TreatmentsWithConfig} The map with all the TreatmentWithConfig objects
|
|
1400
1403
|
*/
|
|
1401
|
-
getTreatmentsWithConfig(key: SplitKey,
|
|
1404
|
+
getTreatmentsWithConfig(key: SplitKey, featureFlagNames: string[], attributes?: Attributes): TreatmentsWithConfig,
|
|
1402
1405
|
/**
|
|
1403
1406
|
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the given features.
|
|
1404
1407
|
* For usage on the Browser as we defined the key on the settings.
|
|
1405
1408
|
* @function getTreatmentsWithConfig
|
|
1406
|
-
* @param {Array<string>}
|
|
1409
|
+
* @param {Array<string>} featureFlagNames - An array of the feature flag names we want to get the treatments.
|
|
1407
1410
|
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
|
|
1408
1411
|
* @returns {TreatmentsWithConfig} The map with all the TreatmentWithConfig objects
|
|
1409
1412
|
*/
|
|
1410
|
-
getTreatmentsWithConfig(
|
|
1413
|
+
getTreatmentsWithConfig(featureFlagNames: string[], attributes?: Attributes): TreatmentsWithConfig,
|
|
1411
1414
|
/**
|
|
1412
|
-
* Tracks an event to be fed to the results product on Split
|
|
1415
|
+
* Tracks an event to be fed to the results product on Split user interface.
|
|
1413
1416
|
* For usage on NodeJS as we don't have only one key.
|
|
1414
1417
|
* @function track
|
|
1415
1418
|
* @param {SplitKey} key - The key that identifies the entity related to this event.
|
|
@@ -1421,7 +1424,7 @@ declare namespace SplitIO {
|
|
|
1421
1424
|
*/
|
|
1422
1425
|
track(key: SplitIO.SplitKey, trafficType: string, eventType: string, value?: number, properties?: Properties): boolean,
|
|
1423
1426
|
/**
|
|
1424
|
-
* Tracks an event to be fed to the results product on Split
|
|
1427
|
+
* Tracks an event to be fed to the results product on Split user interface.
|
|
1425
1428
|
* For usage on the Browser as we defined the key on the settings.
|
|
1426
1429
|
* @function track
|
|
1427
1430
|
* @param {string} trafficType - The traffic type of the entity related to this event.
|
|
@@ -1432,7 +1435,7 @@ declare namespace SplitIO {
|
|
|
1432
1435
|
*/
|
|
1433
1436
|
track(trafficType: string, eventType: string, value?: number, properties?: Properties): boolean,
|
|
1434
1437
|
/**
|
|
1435
|
-
* Tracks an event to be fed to the results product on Split
|
|
1438
|
+
* Tracks an event to be fed to the results product on Split user interface.
|
|
1436
1439
|
* For usage on the Browser if we defined the key and also the trafficType on the settings.
|
|
1437
1440
|
* @function track
|
|
1438
1441
|
* @param {string} eventType - The event type corresponding to this event.
|
|
@@ -1502,44 +1505,44 @@ declare namespace SplitIO {
|
|
|
1502
1505
|
* NOTE: Treatment will be a promise only in async storages, like REDIS.
|
|
1503
1506
|
* @function getTreatment
|
|
1504
1507
|
* @param {string} key - The string key representing the consumer.
|
|
1505
|
-
* @param {string}
|
|
1508
|
+
* @param {string} featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1506
1509
|
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
|
|
1507
|
-
* @returns {AsyncTreatment} Treatment promise
|
|
1510
|
+
* @returns {AsyncTreatment} Treatment promise that resolves to the treatment string.
|
|
1508
1511
|
*/
|
|
1509
|
-
getTreatment(key: SplitKey,
|
|
1512
|
+
getTreatment(key: SplitKey, featureFlagName: string, attributes?: Attributes): AsyncTreatment,
|
|
1510
1513
|
/**
|
|
1511
1514
|
* Returns a TreatmentWithConfig value, which will be (or eventually be) an object with both treatment and config string for the given feature.
|
|
1512
1515
|
* For usage on NodeJS as we don't have only one key.
|
|
1513
1516
|
* NOTE: Treatment will be a promise only in async storages, like REDIS.
|
|
1514
1517
|
* @function getTreatmentWithConfig
|
|
1515
1518
|
* @param {string} key - The string key representing the consumer.
|
|
1516
|
-
* @param {string}
|
|
1519
|
+
* @param {string} featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1517
1520
|
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
|
|
1518
|
-
* @returns {AsyncTreatmentWithConfig} TreatmentWithConfig promise
|
|
1521
|
+
* @returns {AsyncTreatmentWithConfig} TreatmentWithConfig promise that resolves to the TreatmentWithConfig object.
|
|
1519
1522
|
*/
|
|
1520
|
-
getTreatmentWithConfig(key: SplitKey,
|
|
1523
|
+
getTreatmentWithConfig(key: SplitKey, featureFlagName: string, attributes?: Attributes): AsyncTreatmentWithConfig,
|
|
1521
1524
|
/**
|
|
1522
1525
|
* Returns a Treatments value, which will be (or eventually be) an object map with the treatments for the given features.
|
|
1523
1526
|
* For usage on NodeJS as we don't have only one key.
|
|
1524
1527
|
* @function getTreatments
|
|
1525
1528
|
* @param {string} key - The string key representing the consumer.
|
|
1526
|
-
* @param {Array<string>}
|
|
1529
|
+
* @param {Array<string>} featureFlagNames - An array of the feature flag names we want to get the treatments.
|
|
1527
1530
|
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
|
|
1528
|
-
* @returns {AsyncTreatments} Treatments promise
|
|
1531
|
+
* @returns {AsyncTreatments} Treatments promise that resolves to the treatments object map.
|
|
1529
1532
|
*/
|
|
1530
|
-
getTreatments(key: SplitKey,
|
|
1533
|
+
getTreatments(key: SplitKey, featureFlagNames: string[], attributes?: Attributes): AsyncTreatments,
|
|
1531
1534
|
/**
|
|
1532
1535
|
* Returns a TreatmentsWithConfig value, which will be (or eventually be) an object map with the TreatmentWithConfig (an object with both treatment and config string) for the given features.
|
|
1533
1536
|
* For usage on NodeJS as we don't have only one key.
|
|
1534
1537
|
* @function getTreatmentsWithConfig
|
|
1535
1538
|
* @param {string} key - The string key representing the consumer.
|
|
1536
|
-
* @param {Array<string>}
|
|
1539
|
+
* @param {Array<string>} featureFlagNames - An array of the feature flag names we want to get the treatments.
|
|
1537
1540
|
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
|
|
1538
|
-
* @returns {AsyncTreatmentsWithConfig} TreatmentsWithConfig promise
|
|
1541
|
+
* @returns {AsyncTreatmentsWithConfig} TreatmentsWithConfig promise that resolves to the map of TreatmentsWithConfig objects.
|
|
1539
1542
|
*/
|
|
1540
|
-
getTreatmentsWithConfig(key: SplitKey,
|
|
1543
|
+
getTreatmentsWithConfig(key: SplitKey, featureFlagNames: string[], attributes?: Attributes): AsyncTreatmentsWithConfig,
|
|
1541
1544
|
/**
|
|
1542
|
-
* Tracks an event to be fed to the results product on Split
|
|
1545
|
+
* Tracks an event to be fed to the results product on Split user interface, and returns a promise to signal when the event was successfully queued (or not).
|
|
1543
1546
|
* @function track
|
|
1544
1547
|
* @param {SplitKey} key - The key that identifies the entity related to this event.
|
|
1545
1548
|
* @param {string} trafficType - The traffic type of the entity related to this event.
|
|
@@ -1557,24 +1560,24 @@ declare namespace SplitIO {
|
|
|
1557
1560
|
*/
|
|
1558
1561
|
interface IManager extends IStatusInterface {
|
|
1559
1562
|
/**
|
|
1560
|
-
* Get the array of
|
|
1563
|
+
* Get the array of feature flag names.
|
|
1561
1564
|
* @function names
|
|
1562
|
-
* @returns {SplitNames} The
|
|
1565
|
+
* @returns {SplitNames} The list of feature flag names.
|
|
1563
1566
|
*/
|
|
1564
1567
|
names(): SplitNames;
|
|
1565
1568
|
/**
|
|
1566
|
-
* Get the array of
|
|
1569
|
+
* Get the array of feature flags data in SplitView format.
|
|
1567
1570
|
* @function splits
|
|
1568
1571
|
* @returns {SplitViews} The list of SplitIO.SplitView.
|
|
1569
1572
|
*/
|
|
1570
1573
|
splits(): SplitViews;
|
|
1571
1574
|
/**
|
|
1572
|
-
* Get the data of a
|
|
1575
|
+
* Get the data of a feature flag in SplitView format.
|
|
1573
1576
|
* @function split
|
|
1574
|
-
* @param {string}
|
|
1575
|
-
* @returns {SplitView | null} The SplitIO.SplitView of the given
|
|
1577
|
+
* @param {string} featureFlagName The name of the feature flag we want to get info of.
|
|
1578
|
+
* @returns {SplitView | null} The SplitIO.SplitView of the given feature flag name or null if the feature flag is not found.
|
|
1576
1579
|
*/
|
|
1577
|
-
split(
|
|
1580
|
+
split(featureFlagName: string): SplitView | null;
|
|
1578
1581
|
}
|
|
1579
1582
|
/**
|
|
1580
1583
|
* Representation of a manager instance with asynchronous storage of the SDK.
|
|
@@ -1583,23 +1586,23 @@ declare namespace SplitIO {
|
|
|
1583
1586
|
*/
|
|
1584
1587
|
interface IAsyncManager extends IStatusInterface {
|
|
1585
1588
|
/**
|
|
1586
|
-
* Get the array of
|
|
1589
|
+
* Get the array of feature flag names.
|
|
1587
1590
|
* @function names
|
|
1588
|
-
* @returns {SplitNamesAsync} A promise that
|
|
1591
|
+
* @returns {SplitNamesAsync} A promise that resolves to the list of feature flag names.
|
|
1589
1592
|
*/
|
|
1590
1593
|
names(): SplitNamesAsync;
|
|
1591
1594
|
/**
|
|
1592
|
-
* Get the array of
|
|
1595
|
+
* Get the array of feature flags data in SplitView format.
|
|
1593
1596
|
* @function splits
|
|
1594
|
-
* @returns {SplitViewsAsync} A promise that
|
|
1597
|
+
* @returns {SplitViewsAsync} A promise that resolves to the SplitIO.SplitView list.
|
|
1595
1598
|
*/
|
|
1596
1599
|
splits(): SplitViewsAsync;
|
|
1597
1600
|
/**
|
|
1598
|
-
* Get the data of a
|
|
1601
|
+
* Get the data of a feature flag in SplitView format.
|
|
1599
1602
|
* @function split
|
|
1600
|
-
* @param {string}
|
|
1601
|
-
* @returns {SplitViewAsync} A promise that
|
|
1603
|
+
* @param {string} featureFlagName The name of the feature flag we want to get info of.
|
|
1604
|
+
* @returns {SplitViewAsync} A promise that resolves to the SplitIO.SplitView value.
|
|
1602
1605
|
*/
|
|
1603
|
-
split(
|
|
1606
|
+
split(featureFlagName: string): SplitViewAsync;
|
|
1604
1607
|
}
|
|
1605
1608
|
}
|