@featbit/js-client-sdk 3.0.13 → 3.0.14
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/LICENSE +21 -21
- package/README.md +301 -301
- package/dist/esm/IFbClientCore.d.ts +1 -1
- package/dist/esm/IFbClientCore.d.ts.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/umd/{featbit-js-client-sdk-3.0.13.js → featbit-js-client-sdk-3.0.14.js} +2 -2
- package/dist/umd/featbit-js-client-sdk-3.0.14.js.map +1 -0
- package/dist/umd/featbit-js-client-sdk.js +1 -1
- package/dist/umd/featbit-js-client-sdk.js.map +1 -1
- package/package.json +46 -46
- package/src/Configuration.ts +232 -232
- package/src/Context.ts +61 -61
- package/src/FbClientBuilder.ts +167 -167
- package/src/FbClientCore.ts +405 -405
- package/src/IContextProperty.ts +3 -3
- package/src/IDataKind.ts +11 -11
- package/src/IFbClient.ts +29 -29
- package/src/IFbClientCore.ts +290 -290
- package/src/IVersionedData.ts +18 -18
- package/src/bootstrap/IBootstrapProvider.ts +4 -4
- package/src/bootstrap/JsonBootstrapProvider.ts +34 -34
- package/src/bootstrap/NullBootstrapProvider.ts +20 -20
- package/src/bootstrap/index.ts +2 -2
- package/src/constants.ts +1 -1
- package/src/data-sources/DataSourceUpdates.ts +116 -116
- package/src/data-sources/createStreamListeners.ts +67 -67
- package/src/data-sources/index.ts +1 -1
- package/src/data-sync/DataSyncMode.ts +3 -3
- package/src/data-sync/IDataSynchronizer.ts +15 -15
- package/src/data-sync/IRequestor.ts +10 -10
- package/src/data-sync/NullDataSynchronizer.ts +14 -14
- package/src/data-sync/PollingDataSynchronizer.ts +125 -125
- package/src/data-sync/Requestor.ts +61 -61
- package/src/data-sync/WebSocketDataSynchronizer.ts +77 -77
- package/src/data-sync/index.ts +8 -8
- package/src/data-sync/types.ts +19 -19
- package/src/data-sync/utils.ts +31 -31
- package/src/errors.ts +47 -47
- package/src/evaluation/EvalResult.ts +35 -35
- package/src/evaluation/Evaluator.ts +26 -26
- package/src/evaluation/IEvalDetail.ts +23 -23
- package/src/evaluation/ReasonKinds.ts +9 -9
- package/src/evaluation/data/IFlag.ts +29 -29
- package/src/evaluation/index.ts +4 -4
- package/src/events/DefaultEventProcessor.ts +83 -83
- package/src/events/DefaultEventQueue.ts +49 -49
- package/src/events/DefaultEventSender.ts +73 -73
- package/src/events/DefaultEventSerializer.ts +11 -11
- package/src/events/EventDispatcher.ts +127 -127
- package/src/events/EventSerializer.ts +4 -4
- package/src/events/IEventProcessor.ts +8 -8
- package/src/events/IEventQueue.ts +16 -16
- package/src/events/IEventSender.ts +13 -13
- package/src/events/NullEventProcessor.ts +15 -15
- package/src/events/event.ts +129 -129
- package/src/events/index.ts +11 -11
- package/src/index.ts +21 -21
- package/src/integrations/TestLogger.ts +24 -24
- package/src/integrations/index.ts +1 -1
- package/src/integrations/test_data/FlagBuilder.ts +59 -59
- package/src/integrations/test_data/TestData.ts +57 -57
- package/src/integrations/test_data/TestDataSynchronizer.ts +49 -49
- package/src/integrations/test_data/index.ts +4 -4
- package/src/logging/BasicLogger.ts +108 -108
- package/src/logging/IBasicLoggerOptions.ts +46 -46
- package/src/logging/ILogger.ts +49 -49
- package/src/logging/LogLevel.ts +8 -8
- package/src/logging/SafeLogger.ts +69 -69
- package/src/logging/format.ts +154 -154
- package/src/logging/index.ts +5 -5
- package/src/options/ClientContext.ts +39 -39
- package/src/options/IClientContext.ts +53 -53
- package/src/options/IOptions.ts +123 -123
- package/src/options/IUser.ts +6 -6
- package/src/options/IValidatedOptions.ts +29 -29
- package/src/options/OptionMessages.ts +35 -35
- package/src/options/UserBuilder.ts +35 -35
- package/src/options/Validators.ts +300 -300
- package/src/options/index.ts +7 -7
- package/src/platform/IInfo.ts +102 -102
- package/src/platform/IPlatform.ts +20 -20
- package/src/platform/IStore.ts +112 -112
- package/src/platform/IWebSocket.ts +22 -22
- package/src/platform/browser/BrowserInfo.ts +24 -24
- package/src/platform/browser/BrowserPlatform.ts +19 -19
- package/src/platform/browser/BrowserRequests.ts +6 -6
- package/src/platform/browser/BrowserWebSocket.ts +147 -147
- package/src/platform/browser/FbClient.ts +65 -65
- package/src/platform/browser/LocalStorageStore.ts +59 -59
- package/src/platform/index.ts +11 -11
- package/src/platform/requests.ts +76 -76
- package/src/store/BaseStore.ts +125 -125
- package/src/store/DataKinds.ts +6 -6
- package/src/store/IDataSourceUpdates.ts +68 -68
- package/src/store/InMemoryStore.ts +36 -36
- package/src/store/index.ts +5 -5
- package/src/store/serialization.ts +52 -52
- package/src/store/store.ts +37 -37
- package/src/utils/Emits.ts +75 -75
- package/src/utils/EventEmitter.ts +128 -128
- package/src/utils/IEventEmitter.ts +14 -14
- package/src/utils/Regex.ts +21 -21
- package/src/utils/ValueConverters.ts +55 -55
- package/src/utils/canonicalizeUri.ts +3 -3
- package/src/utils/debounce.ts +33 -33
- package/src/utils/http.ts +40 -40
- package/src/utils/index.ts +5 -5
- package/src/utils/isNullOrUndefined.ts +2 -2
- package/src/utils/serializeUser.ts +27 -27
- package/src/utils/sleep.ts +5 -5
- package/src/version.ts +1 -1
- package/dist/umd/featbit-js-client-sdk-3.0.13.js.map +0 -1
package/src/IContextProperty.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface IContextProperty {
|
|
2
|
-
name: string;
|
|
3
|
-
value: string;
|
|
1
|
+
export interface IContextProperty {
|
|
2
|
+
name: string;
|
|
3
|
+
value: string;
|
|
4
4
|
}
|
package/src/IDataKind.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Used internally to describe the type of data being queried or updated, such as feature flags or
|
|
3
|
-
* user segments.
|
|
4
|
-
*/
|
|
5
|
-
export interface IDataKind {
|
|
6
|
-
/**
|
|
7
|
-
* A string such as `"flags"` or `"segments"` which can be used in keys to distinguish this
|
|
8
|
-
* kind of data from other kinds.
|
|
9
|
-
*/
|
|
10
|
-
namespace: string;
|
|
11
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Used internally to describe the type of data being queried or updated, such as feature flags or
|
|
3
|
+
* user segments.
|
|
4
|
+
*/
|
|
5
|
+
export interface IDataKind {
|
|
6
|
+
/**
|
|
7
|
+
* A string such as `"flags"` or `"segments"` which can be used in keys to distinguish this
|
|
8
|
+
* kind of data from other kinds.
|
|
9
|
+
*/
|
|
10
|
+
namespace: string;
|
|
11
|
+
}
|
package/src/IFbClient.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { IFbClientCore } from "./IFbClientCore";
|
|
2
|
-
import { IEventEmitter } from "./utils/IEventEmitter";
|
|
3
|
-
|
|
4
|
-
export interface IFbClient extends IFbClientCore, IEventEmitter {
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* Registers an event listener that will be called when the client triggers some type of event.
|
|
8
|
-
*
|
|
9
|
-
* This is the standard `on` method inherited from Node's `EventEmitter`; see the
|
|
10
|
-
* {@link https://nodejs.org/api/events.html#events_class_eventemitter|Node API docs} for more
|
|
11
|
-
* details on how to manage event listeners. Here is a description of the event types defined
|
|
12
|
-
* by `FbClient`.
|
|
13
|
-
*
|
|
14
|
-
* - `"ready"`: Sent only once, when the client has successfully connected to FeatBit.
|
|
15
|
-
* Alternately, you can detect this with [[waitForInitialization]].
|
|
16
|
-
* - `"failed"`: Sent only once, if the client has permanently failed to connect to FeatBit.
|
|
17
|
-
* Alternately, you can detect this with [[waitForInitialization]].
|
|
18
|
-
* - `"error"`: Contains an error object describing some abnormal condition that the client has detected
|
|
19
|
-
* (such as a network error).
|
|
20
|
-
* - `"update"`: The client has received a change to a feature flag. The event parameter is an object
|
|
21
|
-
* containing a single property, `key`, the flag key. Note that this does not necessarily mean the flag's
|
|
22
|
-
* value has changed for any particular context, only that some part of the flag configuration was changed.
|
|
23
|
-
* - `"update:KEY"`: The client has received a change to the feature flag whose key is KEY. This is the
|
|
24
|
-
* same as `"update"` but allows you to listen for a specific flag.
|
|
25
|
-
*
|
|
26
|
-
* @param event the name of the event to listen for
|
|
27
|
-
* @param listener the function to call when the event happens
|
|
28
|
-
*/
|
|
29
|
-
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1
|
+
import { IFbClientCore } from "./IFbClientCore";
|
|
2
|
+
import { IEventEmitter } from "./utils/IEventEmitter";
|
|
3
|
+
|
|
4
|
+
export interface IFbClient extends IFbClientCore, IEventEmitter {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* Registers an event listener that will be called when the client triggers some type of event.
|
|
8
|
+
*
|
|
9
|
+
* This is the standard `on` method inherited from Node's `EventEmitter`; see the
|
|
10
|
+
* {@link https://nodejs.org/api/events.html#events_class_eventemitter|Node API docs} for more
|
|
11
|
+
* details on how to manage event listeners. Here is a description of the event types defined
|
|
12
|
+
* by `FbClient`.
|
|
13
|
+
*
|
|
14
|
+
* - `"ready"`: Sent only once, when the client has successfully connected to FeatBit.
|
|
15
|
+
* Alternately, you can detect this with [[waitForInitialization]].
|
|
16
|
+
* - `"failed"`: Sent only once, if the client has permanently failed to connect to FeatBit.
|
|
17
|
+
* Alternately, you can detect this with [[waitForInitialization]].
|
|
18
|
+
* - `"error"`: Contains an error object describing some abnormal condition that the client has detected
|
|
19
|
+
* (such as a network error).
|
|
20
|
+
* - `"update"`: The client has received a change to a feature flag. The event parameter is an object
|
|
21
|
+
* containing a single property, `key`, the flag key. Note that this does not necessarily mean the flag's
|
|
22
|
+
* value has changed for any particular context, only that some part of the flag configuration was changed.
|
|
23
|
+
* - `"update:KEY"`: The client has received a change to the feature flag whose key is KEY. This is the
|
|
24
|
+
* same as `"update"` but allows you to listen for a specific flag.
|
|
25
|
+
*
|
|
26
|
+
* @param event the name of the event to listen for
|
|
27
|
+
* @param listener the function to call when the event happens
|
|
28
|
+
*/
|
|
29
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
30
30
|
}
|