@splitsoftware/splitio-commons 3.1.1-rc.10 → 3.1.1-rc.12
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 +3 -0
- package/cjs/evaluator/condition/index.js +2 -2
- package/cjs/evaluator/fallbackTreatmentsCalculator/fallbackSanitizer/index.js +5 -8
- package/cjs/evaluator/index.js +81 -71
- package/cjs/listeners/browser.js +2 -1
- package/cjs/listeners/node.js +4 -4
- package/cjs/logger/constants.js +15 -20
- package/cjs/logger/messages/debug.js +5 -6
- package/cjs/logger/messages/error.js +3 -3
- package/cjs/logger/messages/info.js +3 -4
- package/cjs/logger/messages/warn.js +6 -7
- package/cjs/platform/browser.js +15 -0
- package/cjs/platform/getEventSource/browser.js +8 -0
- package/cjs/platform/getEventSource/eventsource.js +480 -0
- package/cjs/platform/getEventSource/node.js +26 -0
- package/cjs/platform/getFetch/browser.js +9 -0
- package/cjs/platform/getFetch/node.js +27 -0
- package/cjs/platform/getOptions/node.js +25 -0
- package/cjs/platform/node.js +17 -0
- package/cjs/presets/serverSide.js +2 -2
- package/cjs/readiness/constants.js +5 -4
- package/cjs/readiness/readinessManager.js +23 -23
- package/cjs/readiness/sdkReadinessManager.js +1 -17
- package/cjs/sdkClient/client.js +24 -50
- package/cjs/sdkClient/clientInputValidation.js +6 -17
- package/cjs/sdkClient/sdkClient.js +3 -60
- package/cjs/sdkClient/sdkLifecycle.js +74 -0
- package/cjs/sdkClient/trackMethod.js +56 -0
- package/cjs/sdkFactory/index.js +11 -15
- package/cjs/sdkManager/index.js +5 -5
- package/cjs/services/authProvider.js +80 -0
- package/cjs/services/decorateHeaders.js +2 -1
- package/cjs/{sync/streaming/AuthClient/index.js → services/fetchAuth.js} +15 -16
- package/cjs/services/secureSplitHttpClient.js +36 -0
- package/cjs/services/serviceApi.js +147 -0
- package/cjs/services/splitApi.js +24 -10
- package/cjs/services/splitHttpClient.js +3 -5
- package/cjs/storages/AbstractDefinitionsCacheAsync.js +51 -0
- package/cjs/storages/AbstractDefinitionsCacheSync.js +76 -0
- package/cjs/storages/KeyBuilder.js +6 -6
- package/cjs/storages/KeyBuilderCS.js +5 -5
- package/cjs/storages/KeyBuilderSS.js +2 -2
- package/cjs/storages/getRolloutPlan.js +3 -3
- package/cjs/storages/inLocalStorage/DefinitionsCacheInLocal.js +195 -0
- package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +1 -2
- package/cjs/storages/inLocalStorage/RBSegmentsCacheInLocal.js +12 -11
- package/cjs/storages/inLocalStorage/index.js +6 -6
- package/cjs/storages/inLocalStorage/validateCache.js +3 -3
- package/cjs/storages/inMemory/DefinitionsCacheInMemory.js +122 -0
- package/cjs/storages/inMemory/InMemoryStorage.js +4 -4
- package/cjs/storages/inMemory/InMemoryStorageCS.js +5 -5
- package/cjs/storages/inMemory/RBSegmentsCacheInMemory.js +7 -6
- package/cjs/storages/inMemory/SegmentsCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/TelemetryCacheInMemory.js +5 -5
- package/cjs/storages/inRedis/{SplitsCacheInRedis.js → DefinitionsCacheInRedis.js} +79 -77
- package/cjs/storages/inRedis/RBSegmentsCacheInRedis.js +4 -2
- package/cjs/storages/inRedis/index.js +2 -2
- package/cjs/storages/pluggable/DefinitionsCachePluggable.js +214 -0
- package/cjs/storages/pluggable/RBSegmentsCachePluggable.js +4 -2
- package/cjs/storages/pluggable/index.js +2 -2
- package/cjs/storages/setRolloutPlan.js +4 -4
- package/cjs/storages/utils.js +1 -0
- package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +5 -5
- package/cjs/sync/polling/fetchers/splitChangesFetcher.js +24 -15
- package/cjs/sync/polling/pollingManagerCS.js +86 -81
- package/cjs/sync/polling/pollingManagerSS.js +44 -36
- package/cjs/sync/polling/syncTasks/definitionsSyncTask.js +13 -0
- package/cjs/sync/polling/syncTasks/segmentsSyncTask.js +2 -3
- package/cjs/sync/polling/updaters/definitionChangesUpdater.js +207 -0
- package/cjs/sync/polling/updaters/mySegmentsUpdater.js +3 -3
- package/cjs/sync/polling/updaters/segmentChangesUpdater.js +6 -6
- package/cjs/sync/streaming/SSEHandler/NotificationKeeper.js +1 -1
- package/cjs/sync/streaming/SSEHandler/index.js +2 -1
- package/cjs/sync/streaming/UpdateWorkers/{SplitsUpdateWorker.js → DefinitionsUpdateWorker.js} +19 -20
- package/cjs/sync/streaming/constants.js +4 -3
- package/cjs/sync/streaming/parseUtils.js +14 -14
- package/cjs/sync/streaming/pushManager.js +22 -26
- package/cjs/sync/submitters/eventsSubmitter.js +1 -1
- package/cjs/sync/submitters/impressionCountsSubmitter.js +1 -1
- package/cjs/sync/submitters/impressionsSubmitter.js +5 -4
- package/cjs/sync/submitters/telemetrySubmitter.js +3 -4
- package/cjs/sync/submitters/uniqueKeysSubmitter.js +1 -1
- package/cjs/sync/syncManagerOnline.js +5 -5
- package/cjs/utils/Backoff.js +35 -3
- package/cjs/utils/EventEmitter.js +391 -0
- package/cjs/utils/filter/bloomFilter.js +37 -0
- package/cjs/utils/inputValidation/{split.js → definition.js} +10 -10
- package/cjs/utils/inputValidation/{splitExistence.js → definitionExistence.js} +6 -6
- package/cjs/utils/inputValidation/definitions.js +25 -0
- package/cjs/utils/inputValidation/index.js +7 -7
- package/cjs/utils/inputValidation/isOperational.js +4 -4
- package/cjs/utils/inputValidation/target.js +22 -0
- package/cjs/utils/labels/index.js +3 -3
- package/cjs/utils/settingsValidation/index.js +2 -0
- package/cjs/utils/settingsValidation/splitFilters.js +3 -3
- package/cjs/utils/settingsValidation/url.js +6 -2
- package/esm/evaluator/condition/index.js +2 -2
- package/esm/evaluator/fallbackTreatmentsCalculator/fallbackSanitizer/index.js +5 -8
- package/esm/evaluator/index.js +80 -71
- package/esm/listeners/browser.js +2 -1
- package/esm/listeners/node.js +4 -4
- package/esm/logger/constants.js +12 -17
- package/esm/logger/messages/debug.js +5 -6
- package/esm/logger/messages/error.js +3 -3
- package/esm/logger/messages/info.js +3 -4
- package/esm/logger/messages/warn.js +6 -7
- package/esm/platform/browser.js +12 -0
- package/esm/platform/getEventSource/browser.js +4 -0
- package/esm/platform/getEventSource/eventsource.js +480 -0
- package/esm/platform/getEventSource/node.js +20 -0
- package/esm/platform/getFetch/browser.js +5 -0
- package/esm/platform/getFetch/node.js +22 -0
- package/esm/platform/getOptions/node.js +20 -0
- package/esm/platform/node.js +14 -0
- package/esm/presets/serverSide.js +2 -2
- package/esm/readiness/constants.js +4 -3
- package/esm/readiness/readinessManager.js +24 -24
- package/esm/readiness/sdkReadinessManager.js +2 -18
- package/esm/sdkClient/client.js +23 -50
- package/esm/sdkClient/clientInputValidation.js +8 -19
- package/esm/sdkClient/sdkClient.js +3 -60
- package/esm/sdkClient/sdkLifecycle.js +70 -0
- package/esm/sdkClient/trackMethod.js +52 -0
- package/esm/sdkFactory/index.js +12 -16
- package/esm/sdkManager/index.js +6 -6
- package/esm/services/authProvider.js +76 -0
- package/esm/services/decorateHeaders.js +2 -1
- package/esm/{sync/streaming/AuthClient/index.js → services/fetchAuth.js} +13 -13
- package/esm/services/secureSplitHttpClient.js +32 -0
- package/esm/services/serviceApi.js +143 -0
- package/esm/services/splitApi.js +24 -10
- package/esm/services/splitHttpClient.js +3 -5
- package/esm/storages/AbstractDefinitionsCacheAsync.js +48 -0
- package/esm/storages/AbstractDefinitionsCacheSync.js +71 -0
- package/esm/storages/KeyBuilder.js +6 -6
- package/esm/storages/KeyBuilderCS.js +5 -5
- package/esm/storages/KeyBuilderSS.js +2 -2
- package/esm/storages/getRolloutPlan.js +3 -3
- package/esm/storages/inLocalStorage/DefinitionsCacheInLocal.js +192 -0
- package/esm/storages/inLocalStorage/MySegmentsCacheInLocal.js +1 -2
- package/esm/storages/inLocalStorage/RBSegmentsCacheInLocal.js +9 -8
- package/esm/storages/inLocalStorage/index.js +6 -6
- package/esm/storages/inLocalStorage/validateCache.js +3 -3
- package/esm/storages/inMemory/DefinitionsCacheInMemory.js +119 -0
- package/esm/storages/inMemory/InMemoryStorage.js +4 -4
- package/esm/storages/inMemory/InMemoryStorageCS.js +5 -5
- package/esm/storages/inMemory/RBSegmentsCacheInMemory.js +4 -3
- package/esm/storages/inMemory/SegmentsCacheInMemory.js +1 -1
- package/esm/storages/inMemory/TelemetryCacheInMemory.js +5 -5
- package/esm/storages/inRedis/{SplitsCacheInRedis.js → DefinitionsCacheInRedis.js} +78 -76
- package/esm/storages/inRedis/RBSegmentsCacheInRedis.js +4 -2
- package/esm/storages/inRedis/index.js +2 -2
- package/esm/storages/pluggable/DefinitionsCachePluggable.js +211 -0
- package/esm/storages/pluggable/RBSegmentsCachePluggable.js +4 -2
- package/esm/storages/pluggable/index.js +2 -2
- package/esm/storages/setRolloutPlan.js +4 -4
- package/esm/storages/utils.js +1 -0
- package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +6 -6
- package/esm/sync/polling/fetchers/splitChangesFetcher.js +25 -16
- package/esm/sync/polling/pollingManagerCS.js +87 -82
- package/esm/sync/polling/pollingManagerSS.js +44 -36
- package/esm/sync/polling/syncTasks/definitionsSyncTask.js +9 -0
- package/esm/sync/polling/syncTasks/segmentsSyncTask.js +2 -3
- package/esm/sync/polling/updaters/definitionChangesUpdater.js +201 -0
- package/esm/sync/polling/updaters/mySegmentsUpdater.js +3 -3
- package/esm/sync/polling/updaters/segmentChangesUpdater.js +7 -7
- package/esm/sync/streaming/SSEHandler/NotificationKeeper.js +2 -2
- package/esm/sync/streaming/SSEHandler/index.js +3 -2
- package/esm/sync/streaming/UpdateWorkers/{SplitsUpdateWorker.js → DefinitionsUpdateWorker.js} +19 -20
- package/esm/sync/streaming/constants.js +3 -2
- package/esm/sync/streaming/parseUtils.js +11 -11
- package/esm/sync/streaming/pushManager.js +24 -28
- package/esm/sync/submitters/eventsSubmitter.js +1 -1
- package/esm/sync/submitters/impressionCountsSubmitter.js +1 -1
- package/esm/sync/submitters/impressionsSubmitter.js +5 -4
- package/esm/sync/submitters/telemetrySubmitter.js +3 -4
- package/esm/sync/submitters/uniqueKeysSubmitter.js +1 -1
- package/esm/sync/syncManagerOnline.js +4 -4
- package/esm/utils/Backoff.js +35 -3
- package/esm/utils/EventEmitter.js +387 -0
- package/esm/utils/filter/bloomFilter.js +33 -0
- package/esm/utils/inputValidation/{split.js → definition.js} +8 -8
- package/esm/utils/inputValidation/definitionExistence.js +15 -0
- package/esm/utils/inputValidation/definitions.js +21 -0
- package/esm/utils/inputValidation/index.js +3 -3
- package/esm/utils/inputValidation/isOperational.js +4 -4
- package/esm/utils/inputValidation/target.js +18 -0
- package/esm/utils/labels/index.js +2 -2
- package/esm/utils/settingsValidation/index.js +2 -0
- package/esm/utils/settingsValidation/splitFilters.js +3 -3
- package/esm/utils/settingsValidation/url.js +6 -2
- package/package.json +1 -1
- package/src/dtos/types.ts +4 -4
- package/src/services/authProvider.ts +2 -2
- package/src/{sync/streaming/AuthClient/index.ts → services/fetchAuth.ts} +3 -4
- package/src/services/splitApi.ts +1 -1
- package/src/services/types.ts +21 -4
- package/src/storages/AbstractDefinitionsCacheAsync.ts +3 -3
- package/src/storages/AbstractDefinitionsCacheSync.ts +2 -2
- package/src/storages/inLocalStorage/DefinitionsCacheInLocal.ts +2 -2
- package/src/storages/inLocalStorage/RBSegmentsCacheInLocal.ts +3 -3
- package/src/storages/inMemory/DefinitionsCacheInMemory.ts +2 -2
- package/src/storages/inMemory/RBSegmentsCacheInMemory.ts +2 -2
- package/src/storages/inRedis/DefinitionsCacheInRedis.ts +6 -4
- package/src/storages/inRedis/RBSegmentsCacheInRedis.ts +7 -5
- package/src/storages/pluggable/DefinitionsCachePluggable.ts +4 -2
- package/src/storages/pluggable/RBSegmentsCachePluggable.ts +5 -3
- package/src/storages/types.ts +6 -6
- package/src/sync/polling/fetchers/splitChangesFetcher.ts +5 -5
- package/src/sync/polling/types.ts +22 -1
- package/src/sync/polling/updaters/definitionChangesUpdater.ts +26 -20
- package/src/sync/streaming/SSEClient/index.ts +1 -1
- package/src/sync/streaming/SSEClient/types.ts +1 -1
- package/src/sync/streaming/UpdateWorkers/DefinitionsUpdateWorker.ts +15 -11
- package/src/sync/streaming/UpdateWorkers/types.ts +6 -0
- package/src/sync/streaming/parseUtils.ts +3 -4
- package/src/sync/streaming/pushManager.ts +4 -3
- package/cjs/storages/AbstractSplitsCacheAsync.js +0 -51
- package/cjs/storages/AbstractSplitsCacheSync.js +0 -76
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +0 -194
- package/cjs/storages/inMemory/SplitsCacheInMemory.js +0 -121
- package/cjs/storages/pluggable/SplitsCachePluggable.js +0 -212
- package/cjs/sync/polling/syncTasks/splitsSyncTask.js +0 -13
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +0 -200
- package/cjs/sync/streaming/AuthClient/types.js +0 -2
- package/cjs/utils/inputValidation/splits.js +0 -25
- package/esm/storages/AbstractSplitsCacheAsync.js +0 -48
- package/esm/storages/AbstractSplitsCacheSync.js +0 -71
- package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +0 -191
- package/esm/storages/inMemory/SplitsCacheInMemory.js +0 -118
- package/esm/storages/pluggable/SplitsCachePluggable.js +0 -209
- package/esm/sync/polling/syncTasks/splitsSyncTask.js +0 -9
- package/esm/sync/polling/updaters/splitChangesUpdater.js +0 -194
- package/esm/sync/streaming/AuthClient/types.js +0 -1
- package/esm/utils/inputValidation/splitExistence.js +0 -15
- package/esm/utils/inputValidation/splits.js +0 -21
- package/src/sync/streaming/AuthClient/types.ts +0 -19
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { __extends, __spreadArray } from "tslib";
|
|
2
|
-
import { isFiniteNumber, isNaNNumber } from '../../utils/lang';
|
|
3
|
-
import { LOG_PREFIX } from './constants';
|
|
4
|
-
import { AbstractSplitsCacheAsync } from '../AbstractSplitsCacheAsync';
|
|
5
|
-
import { returnDifference } from '../../utils/lang/sets';
|
|
6
|
-
/**
|
|
7
|
-
* ISplitsCacheAsync implementation for pluggable storages.
|
|
8
|
-
*/
|
|
9
|
-
var SplitsCachePluggable = /** @class */ (function (_super) {
|
|
10
|
-
__extends(SplitsCachePluggable, _super);
|
|
11
|
-
/**
|
|
12
|
-
* Create a SplitsCache that uses a storage wrapper.
|
|
13
|
-
* @param log - Logger instance.
|
|
14
|
-
* @param keys - Key builder.
|
|
15
|
-
* @param wrapper - Adapted wrapper storage.
|
|
16
|
-
*/
|
|
17
|
-
function SplitsCachePluggable(log, keys, wrapper, splitFiltersValidation) {
|
|
18
|
-
var _this = _super.call(this) || this;
|
|
19
|
-
_this.log = log;
|
|
20
|
-
_this.keys = keys;
|
|
21
|
-
_this.wrapper = wrapper;
|
|
22
|
-
_this.flagSetsFilter = splitFiltersValidation ? splitFiltersValidation.groupedFilters.bySet : [];
|
|
23
|
-
return _this;
|
|
24
|
-
}
|
|
25
|
-
SplitsCachePluggable.prototype._decrementCounts = function (split) {
|
|
26
|
-
var _this = this;
|
|
27
|
-
var ttKey = this.keys.buildTrafficTypeKey(split.trafficTypeName);
|
|
28
|
-
return this.wrapper.decr(ttKey).then(function (count) {
|
|
29
|
-
if (count === 0)
|
|
30
|
-
return _this.wrapper.del(ttKey);
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
SplitsCachePluggable.prototype._incrementCounts = function (split) {
|
|
34
|
-
var ttKey = this.keys.buildTrafficTypeKey(split.trafficTypeName);
|
|
35
|
-
return this.wrapper.incr(ttKey);
|
|
36
|
-
};
|
|
37
|
-
SplitsCachePluggable.prototype._updateFlagSets = function (featureFlagName, flagSetsOfRemovedFlag, flagSetsOfAddedFlag) {
|
|
38
|
-
var _this = this;
|
|
39
|
-
var removeFromFlagSets = returnDifference(flagSetsOfRemovedFlag, flagSetsOfAddedFlag);
|
|
40
|
-
var addToFlagSets = returnDifference(flagSetsOfAddedFlag, flagSetsOfRemovedFlag);
|
|
41
|
-
if (this.flagSetsFilter.length > 0) {
|
|
42
|
-
addToFlagSets = addToFlagSets.filter(function (flagSet) {
|
|
43
|
-
return _this.flagSetsFilter.some(function (filterFlagSet) { return filterFlagSet === flagSet; });
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
var items = [featureFlagName];
|
|
47
|
-
return Promise.all(__spreadArray(__spreadArray([], removeFromFlagSets.map(function (flagSetName) { return _this.wrapper.removeItems(_this.keys.buildFlagSetKey(flagSetName), items); }), true), addToFlagSets.map(function (flagSetName) { return _this.wrapper.addItems(_this.keys.buildFlagSetKey(flagSetName), items); }), true));
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Add a given split.
|
|
51
|
-
* The returned promise is resolved when the operation success
|
|
52
|
-
* or rejected if it fails (e.g., wrapper operation fails)
|
|
53
|
-
*/
|
|
54
|
-
SplitsCachePluggable.prototype.addSplit = function (split) {
|
|
55
|
-
var _this = this;
|
|
56
|
-
var name = split.name;
|
|
57
|
-
var splitKey = this.keys.buildSplitKey(name);
|
|
58
|
-
return this.wrapper.get(splitKey).then(function (splitFromStorage) {
|
|
59
|
-
// handling parsing error
|
|
60
|
-
var parsedPreviousSplit, stringifiedNewSplit;
|
|
61
|
-
try {
|
|
62
|
-
parsedPreviousSplit = splitFromStorage ? JSON.parse(splitFromStorage) : undefined;
|
|
63
|
-
stringifiedNewSplit = JSON.stringify(split);
|
|
64
|
-
}
|
|
65
|
-
catch (e) {
|
|
66
|
-
throw new Error('Error parsing feature flag definition: ' + e);
|
|
67
|
-
}
|
|
68
|
-
return _this.wrapper.set(splitKey, stringifiedNewSplit).then(function () {
|
|
69
|
-
// avoid unnecessary increment/decrement operations
|
|
70
|
-
if (parsedPreviousSplit && parsedPreviousSplit.trafficTypeName === split.trafficTypeName)
|
|
71
|
-
return;
|
|
72
|
-
// update traffic type counts
|
|
73
|
-
return _this._incrementCounts(split).then(function () {
|
|
74
|
-
if (parsedPreviousSplit)
|
|
75
|
-
return _this._decrementCounts(parsedPreviousSplit);
|
|
76
|
-
});
|
|
77
|
-
}).then(function () { return _this._updateFlagSets(name, parsedPreviousSplit && parsedPreviousSplit.sets, split.sets); });
|
|
78
|
-
}).then(function () { return true; });
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Remove a given split.
|
|
82
|
-
* The returned promise is resolved when the operation success, with a boolean indicating if the split existed or not.
|
|
83
|
-
* or rejected if it fails (e.g., wrapper operation fails).
|
|
84
|
-
*/
|
|
85
|
-
SplitsCachePluggable.prototype.removeSplit = function (name) {
|
|
86
|
-
var _this = this;
|
|
87
|
-
return this.getSplit(name).then(function (split) {
|
|
88
|
-
if (split) {
|
|
89
|
-
return _this._decrementCounts(split).then(function () { return _this._updateFlagSets(name, split.sets); });
|
|
90
|
-
}
|
|
91
|
-
}).then(function () {
|
|
92
|
-
return _this.wrapper.del(_this.keys.buildSplitKey(name));
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Get split.
|
|
97
|
-
* The returned promise is resolved with the split definition or null if it's not defined,
|
|
98
|
-
* or rejected if wrapper operation fails.
|
|
99
|
-
*/
|
|
100
|
-
SplitsCachePluggable.prototype.getSplit = function (name) {
|
|
101
|
-
return this.wrapper.get(this.keys.buildSplitKey(name))
|
|
102
|
-
.then(function (maybeSplit) { return maybeSplit && JSON.parse(maybeSplit); });
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Get list of splits.
|
|
106
|
-
* The returned promise is resolved with a map of split names to their split definition or null if it's not defined,
|
|
107
|
-
* or rejected if wrapper operation fails.
|
|
108
|
-
*/
|
|
109
|
-
SplitsCachePluggable.prototype.getSplits = function (names) {
|
|
110
|
-
var _this = this;
|
|
111
|
-
var keys = names.map(function (name) { return _this.keys.buildSplitKey(name); });
|
|
112
|
-
return this.wrapper.getMany(keys).then(function (splitDefinitions) {
|
|
113
|
-
var splits = {};
|
|
114
|
-
names.forEach(function (name, idx) {
|
|
115
|
-
var split = splitDefinitions[idx];
|
|
116
|
-
splits[name] = split && JSON.parse(split);
|
|
117
|
-
});
|
|
118
|
-
return Promise.resolve(splits);
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* Get list of all split definitions.
|
|
123
|
-
* The returned promise is resolved with the list of split definitions,
|
|
124
|
-
* or rejected if wrapper operation fails.
|
|
125
|
-
*/
|
|
126
|
-
SplitsCachePluggable.prototype.getAll = function () {
|
|
127
|
-
var _this = this;
|
|
128
|
-
return this.wrapper.getKeysByPrefix(this.keys.buildSplitKeyPrefix())
|
|
129
|
-
.then(function (listOfKeys) { return _this.wrapper.getMany(listOfKeys); })
|
|
130
|
-
.then(function (splitDefinitions) { return splitDefinitions.map(function (splitDefinition) {
|
|
131
|
-
return JSON.parse(splitDefinition);
|
|
132
|
-
}); });
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Get list of split names.
|
|
136
|
-
* The returned promise is resolved with the list of split names,
|
|
137
|
-
* or rejected if wrapper operation fails.
|
|
138
|
-
*/
|
|
139
|
-
SplitsCachePluggable.prototype.getSplitNames = function () {
|
|
140
|
-
var _this = this;
|
|
141
|
-
return this.wrapper.getKeysByPrefix(this.keys.buildSplitKeyPrefix()).then(function (listOfKeys) { return listOfKeys.map(_this.keys.extractKey); });
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* Get list of feature flag names related to a given list of flag set names.
|
|
145
|
-
* The returned promise is resolved with the list of feature flag names per flag set.
|
|
146
|
-
* It never rejects (If there is a wrapper error for some flag set, an empty set is returned for it).
|
|
147
|
-
*/
|
|
148
|
-
SplitsCachePluggable.prototype.getNamesByFlagSets = function (flagSets) {
|
|
149
|
-
var _this = this;
|
|
150
|
-
return Promise.all(flagSets.map(function (flagSet) {
|
|
151
|
-
var flagSetKey = _this.keys.buildFlagSetKey(flagSet);
|
|
152
|
-
return _this.wrapper.getItems(flagSetKey).catch(function () { return []; });
|
|
153
|
-
})).then(function (namesByFlagSets) { return namesByFlagSets.map(function (namesByFlagSet) { return new Set(namesByFlagSet); }); });
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* Check traffic type existence.
|
|
157
|
-
* The returned promise is resolved with a boolean indicating whether the TT exist or not.
|
|
158
|
-
* In case of wrapper operation failures, the promise resolves with a true value, assuming that the TT might exist.
|
|
159
|
-
* It will never be rejected.
|
|
160
|
-
*/
|
|
161
|
-
SplitsCachePluggable.prototype.trafficTypeExists = function (trafficType) {
|
|
162
|
-
var _this = this;
|
|
163
|
-
// If there is a number there should be > 0, otherwise the TT is considered as not existent.
|
|
164
|
-
return this.wrapper.get(this.keys.buildTrafficTypeKey(trafficType))
|
|
165
|
-
.then(function (ttCount) {
|
|
166
|
-
if (ttCount === null)
|
|
167
|
-
return false; // if entry doesn't exist, means that TT doesn't exist
|
|
168
|
-
ttCount = parseInt(ttCount, 10);
|
|
169
|
-
if (!isFiniteNumber(ttCount) || ttCount < 0) {
|
|
170
|
-
_this.log.info(LOG_PREFIX + "Could not validate traffic type existence of ".concat(trafficType, " due to data corruption of some sorts."));
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
173
|
-
return ttCount > 0;
|
|
174
|
-
}).catch(function (e) {
|
|
175
|
-
_this.log.error(LOG_PREFIX + "Could not validate traffic type existence of ".concat(trafficType, " due to an error: ").concat(e, "."));
|
|
176
|
-
// If there is an error, bypass the validation so the event can get tracked.
|
|
177
|
-
return true;
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
|
-
/**
|
|
181
|
-
* Set till number.
|
|
182
|
-
* The returned promise is resolved when the operation success,
|
|
183
|
-
* or rejected if it fails (e.g., wrapper operation fails).
|
|
184
|
-
*/
|
|
185
|
-
SplitsCachePluggable.prototype.setChangeNumber = function (changeNumber) {
|
|
186
|
-
return this.wrapper.set(this.keys.buildSplitsTillKey(), changeNumber + '');
|
|
187
|
-
};
|
|
188
|
-
/**
|
|
189
|
-
* Get till number or -1 if it's not defined.
|
|
190
|
-
* The returned promise is resolved with the changeNumber or -1 if it doesn't exist or a wrapper operation fails.
|
|
191
|
-
* The promise will never be rejected.
|
|
192
|
-
*/
|
|
193
|
-
SplitsCachePluggable.prototype.getChangeNumber = function () {
|
|
194
|
-
var _this = this;
|
|
195
|
-
return this.wrapper.get(this.keys.buildSplitsTillKey()).then(function (value) {
|
|
196
|
-
var i = parseInt(value, 10);
|
|
197
|
-
return isNaNNumber(i) ? -1 : i;
|
|
198
|
-
}).catch(function (e) {
|
|
199
|
-
_this.log.error(LOG_PREFIX + 'Could not retrieve changeNumber from storage. Error: ' + e);
|
|
200
|
-
return -1;
|
|
201
|
-
});
|
|
202
|
-
};
|
|
203
|
-
// @TODO implement if required by DataLoader or producer mode
|
|
204
|
-
SplitsCachePluggable.prototype.clear = function () {
|
|
205
|
-
return Promise.resolve(true);
|
|
206
|
-
};
|
|
207
|
-
return SplitsCachePluggable;
|
|
208
|
-
}(AbstractSplitsCacheAsync));
|
|
209
|
-
export { SplitsCachePluggable };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { syncTaskFactory } from '../../syncTask';
|
|
2
|
-
import { splitChangesFetcherFactory } from '../fetchers/splitChangesFetcher';
|
|
3
|
-
import { splitChangesUpdaterFactory } from '../updaters/splitChangesUpdater';
|
|
4
|
-
/**
|
|
5
|
-
* Creates a sync task that periodically executes a `splitChangesUpdater` task
|
|
6
|
-
*/
|
|
7
|
-
export function splitsSyncTaskFactory(fetchSplitChanges, storage, readiness, settings, isClientSide) {
|
|
8
|
-
return syncTaskFactory(settings.log, splitChangesUpdaterFactory(settings.log, splitChangesFetcherFactory(fetchSplitChanges, settings, storage), storage, settings.sync.__splitFiltersValidation, readiness.splits, settings.startup.requestTimeoutBeforeReady, settings.startup.retriesOnFailureBeforeReady, isClientSide), settings.scheduler.featuresRefreshRate, 'splitChangesUpdater');
|
|
9
|
-
}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { timeout } from '../../../utils/promise/timeout';
|
|
2
|
-
import { SDK_SPLITS_ARRIVED, FLAGS_UPDATE, SEGMENTS_UPDATE } from '../../../readiness/constants';
|
|
3
|
-
import { SYNC_SPLITS_FETCH, SYNC_SPLITS_UPDATE, SYNC_RBS_UPDATE, SYNC_SPLITS_FETCH_FAILS, SYNC_SPLITS_FETCH_RETRY } from '../../../logger/constants';
|
|
4
|
-
import { startsWith } from '../../../utils/lang';
|
|
5
|
-
import { IN_RULE_BASED_SEGMENT, IN_SEGMENT, RULE_BASED_SEGMENT, STANDARD_SEGMENT } from '../../../utils/constants';
|
|
6
|
-
import { setToArray } from '../../../utils/lang/sets';
|
|
7
|
-
import { SPLIT_UPDATE } from '../../streaming/constants';
|
|
8
|
-
// Checks that all registered segments have been fetched (changeNumber !== -1 for every segment).
|
|
9
|
-
// Returns a promise that could be rejected.
|
|
10
|
-
// @TODO review together with Segments and MySegments storage APIs
|
|
11
|
-
function checkAllSegmentsExist(segments) {
|
|
12
|
-
var registeredSegments = Promise.resolve(segments.getRegisteredSegments());
|
|
13
|
-
return registeredSegments.then(function (segmentNames) {
|
|
14
|
-
return Promise.all(segmentNames.map(function (segmentName) { return segments.getChangeNumber(segmentName); }))
|
|
15
|
-
.then(function (changeNumbers) { return changeNumbers.every(function (changeNumber) { return changeNumber !== undefined; }); });
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Collect segments from a raw FF or RBS definition.
|
|
20
|
-
* Exported for testing purposes.
|
|
21
|
-
*/
|
|
22
|
-
export function parseSegments(ruleEntity, matcherType) {
|
|
23
|
-
if (matcherType === void 0) { matcherType = IN_SEGMENT; }
|
|
24
|
-
var _a = ruleEntity, conditions = _a.conditions, excluded = _a.excluded;
|
|
25
|
-
var segments = new Set();
|
|
26
|
-
if (excluded && excluded.segments) {
|
|
27
|
-
excluded.segments.forEach(function (_a) {
|
|
28
|
-
var type = _a.type, name = _a.name;
|
|
29
|
-
if ((type === STANDARD_SEGMENT && matcherType === IN_SEGMENT) || (type === RULE_BASED_SEGMENT && matcherType === IN_RULE_BASED_SEGMENT)) {
|
|
30
|
-
segments.add(name);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
if (conditions) {
|
|
35
|
-
for (var i = 0; i < conditions.length; i++) {
|
|
36
|
-
var matchers = conditions[i].matcherGroup.matchers;
|
|
37
|
-
matchers.forEach(function (matcher) {
|
|
38
|
-
if (matcher.matcherType === matcherType)
|
|
39
|
-
segments.add(matcher.userDefinedSegmentMatcherData.segmentName);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return segments;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* If there are defined filters and one feature flag doesn't match with them, its status is changed to 'ARCHIVE' to avoid storing it
|
|
47
|
-
* If there is `bySet` filter, `byName` and `byPrefix` filters are ignored
|
|
48
|
-
*
|
|
49
|
-
* @param featureFlag - feature flag to be evaluated
|
|
50
|
-
* @param filters - splitFiltersValidation bySet | byName
|
|
51
|
-
*/
|
|
52
|
-
function matchFilters(featureFlag, filters) {
|
|
53
|
-
var _a = filters.groupedFilters, setsFilter = _a.bySet, namesFilter = _a.byName, prefixFilter = _a.byPrefix;
|
|
54
|
-
if (setsFilter.length > 0)
|
|
55
|
-
return featureFlag.sets && featureFlag.sets.some(function (featureFlagSet) { return setsFilter.indexOf(featureFlagSet) > -1; });
|
|
56
|
-
var namesFilterConfigured = namesFilter.length > 0;
|
|
57
|
-
var prefixFilterConfigured = prefixFilter.length > 0;
|
|
58
|
-
if (!namesFilterConfigured && !prefixFilterConfigured)
|
|
59
|
-
return true;
|
|
60
|
-
var matchNames = namesFilterConfigured && namesFilter.indexOf(featureFlag.name) > -1;
|
|
61
|
-
var matchPrefix = prefixFilterConfigured && prefixFilter.some(function (prefix) { return startsWith(featureFlag.name, prefix); });
|
|
62
|
-
return matchNames || matchPrefix;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Given the list of splits from /splitChanges endpoint, it returns the mutations,
|
|
66
|
-
* i.e., an object with added splits, removed splits and used segments.
|
|
67
|
-
* Exported for testing purposes.
|
|
68
|
-
*/
|
|
69
|
-
export function computeMutation(rules, segments, filters) {
|
|
70
|
-
return rules.reduce(function (accum, ruleEntity) {
|
|
71
|
-
if (ruleEntity.status !== 'ARCHIVED' && (!filters || matchFilters(ruleEntity, filters))) {
|
|
72
|
-
accum.added.push(ruleEntity);
|
|
73
|
-
parseSegments(ruleEntity).forEach(function (segmentName) {
|
|
74
|
-
segments.add(segmentName);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
accum.removed.push(ruleEntity);
|
|
79
|
-
}
|
|
80
|
-
accum.names.push(ruleEntity.name);
|
|
81
|
-
return accum;
|
|
82
|
-
}, { added: [], removed: [], names: [] });
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* factory of SplitChanges updater, a task that:
|
|
86
|
-
* - fetches split changes using `splitChangesFetcher`
|
|
87
|
-
* - updates `splitsCache`
|
|
88
|
-
* - uses `splitsEventEmitter` to emit events related to split data updates
|
|
89
|
-
*
|
|
90
|
-
* @param log - Logger instance
|
|
91
|
-
* @param splitChangesFetcher - Fetcher of `/splitChanges`
|
|
92
|
-
* @param splits - Splits storage, with sync or async methods
|
|
93
|
-
* @param segments - Segments storage, with sync or async methods
|
|
94
|
-
* @param splitsEventEmitter - Optional readiness manager. Not required for synchronizer or producer mode.
|
|
95
|
-
* @param requestTimeoutBeforeReady - How long the updater will wait for the request to timeout. Default 0, i.e., never timeout.
|
|
96
|
-
* @param retriesOnFailureBeforeReady - How many retries on `/splitChanges` we the updater do in case of failure or timeout. Default 0, i.e., no retries.
|
|
97
|
-
*/
|
|
98
|
-
export function splitChangesUpdaterFactory(log, splitChangesFetcher, storage, splitFiltersValidation, splitsEventEmitter, requestTimeoutBeforeReady, retriesOnFailureBeforeReady, isClientSide) {
|
|
99
|
-
if (requestTimeoutBeforeReady === void 0) { requestTimeoutBeforeReady = 0; }
|
|
100
|
-
if (retriesOnFailureBeforeReady === void 0) { retriesOnFailureBeforeReady = 0; }
|
|
101
|
-
var splits = storage.splits, rbSegments = storage.rbSegments, segments = storage.segments;
|
|
102
|
-
var startingUp = true;
|
|
103
|
-
/** timeout decorator for `splitChangesFetcher` promise */
|
|
104
|
-
function _promiseDecorator(promise) {
|
|
105
|
-
if (startingUp && requestTimeoutBeforeReady)
|
|
106
|
-
promise = timeout(requestTimeoutBeforeReady, promise);
|
|
107
|
-
return promise;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* SplitChanges updater returns a promise that resolves with a `false` boolean value if it fails to fetch splits or synchronize them with the storage.
|
|
111
|
-
* Returned promise will not be rejected.
|
|
112
|
-
*
|
|
113
|
-
* @param noCache - true to revalidate data to fetch
|
|
114
|
-
* @param till - query param to bypass CDN requests
|
|
115
|
-
*/
|
|
116
|
-
return function splitChangesUpdater(noCache, till, instantUpdate) {
|
|
117
|
-
/**
|
|
118
|
-
* @param since - current changeNumber at splitsCache
|
|
119
|
-
* @param retry - current number of retry attempts
|
|
120
|
-
*/
|
|
121
|
-
function _splitChangesUpdater(sinces, retry) {
|
|
122
|
-
if (retry === void 0) { retry = 0; }
|
|
123
|
-
var since = sinces[0], rbSince = sinces[1];
|
|
124
|
-
log.debug(SYNC_SPLITS_FETCH, sinces);
|
|
125
|
-
return Promise.resolve(instantUpdate ?
|
|
126
|
-
instantUpdate.type === SPLIT_UPDATE ?
|
|
127
|
-
// IFFU edge case: a change to a flag that adds an IN_RULE_BASED_SEGMENT matcher that is not present yet
|
|
128
|
-
Promise.resolve(rbSegments.contains(parseSegments(instantUpdate.payload, IN_RULE_BASED_SEGMENT))).then(function (contains) {
|
|
129
|
-
return contains ?
|
|
130
|
-
{ ff: { d: [instantUpdate.payload], t: instantUpdate.changeNumber } } :
|
|
131
|
-
splitChangesFetcher(since, noCache, till, rbSince, _promiseDecorator);
|
|
132
|
-
}) :
|
|
133
|
-
{ rbs: { d: [instantUpdate.payload], t: instantUpdate.changeNumber } } :
|
|
134
|
-
splitChangesFetcher(since, noCache, till, rbSince, _promiseDecorator))
|
|
135
|
-
.then(function (splitChanges) {
|
|
136
|
-
var usedSegments = new Set();
|
|
137
|
-
var updatedFlags = [];
|
|
138
|
-
var ffUpdate = false;
|
|
139
|
-
if (splitChanges.ff) {
|
|
140
|
-
var _a = computeMutation(splitChanges.ff.d || [], usedSegments, splitFiltersValidation), added = _a.added, removed = _a.removed, names = _a.names;
|
|
141
|
-
updatedFlags = names;
|
|
142
|
-
log.debug(SYNC_SPLITS_UPDATE, [added.length, removed.length]);
|
|
143
|
-
ffUpdate = splits.update(added, removed, splitChanges.ff.t);
|
|
144
|
-
}
|
|
145
|
-
var rbsUpdate = false;
|
|
146
|
-
if (splitChanges.rbs) {
|
|
147
|
-
var _b = computeMutation(splitChanges.rbs.d || [], usedSegments), added = _b.added, removed = _b.removed;
|
|
148
|
-
log.debug(SYNC_RBS_UPDATE, [added.length, removed.length]);
|
|
149
|
-
rbsUpdate = rbSegments.update(added, removed, splitChanges.rbs.t);
|
|
150
|
-
}
|
|
151
|
-
return Promise.all([ffUpdate, rbsUpdate,
|
|
152
|
-
// @TODO if at least 1 segment fetch fails due to 404 and other segments are updated in the storage, SDK_UPDATE is not emitted
|
|
153
|
-
segments.registerSegments(setToArray(usedSegments))
|
|
154
|
-
]).then(function (_a) {
|
|
155
|
-
var ffChanged = _a[0], rbsChanged = _a[1];
|
|
156
|
-
if (storage.save)
|
|
157
|
-
storage.save();
|
|
158
|
-
startingUp = false;
|
|
159
|
-
if (splitsEventEmitter) {
|
|
160
|
-
// To emit SDK_SPLITS_ARRIVED for server-side SDK, we must check that all registered segments have been fetched
|
|
161
|
-
return Promise.resolve(!splitsEventEmitter.splitsArrived || ((ffChanged || rbsChanged) && (isClientSide || checkAllSegmentsExist(segments))))
|
|
162
|
-
.catch(function () { return false; } /** noop. just to handle a possible `checkAllSegmentsExist` rejection, before emitting SDK event */)
|
|
163
|
-
.then(function (emitSplitsArrivedEvent) {
|
|
164
|
-
// emit SDK events
|
|
165
|
-
if (emitSplitsArrivedEvent) {
|
|
166
|
-
var metadata = {
|
|
167
|
-
type: updatedFlags.length > 0 ? FLAGS_UPDATE : SEGMENTS_UPDATE,
|
|
168
|
-
names: updatedFlags.length > 0 ? updatedFlags : []
|
|
169
|
-
};
|
|
170
|
-
splitsEventEmitter.emit(SDK_SPLITS_ARRIVED, metadata);
|
|
171
|
-
}
|
|
172
|
-
return true;
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
return true;
|
|
176
|
-
});
|
|
177
|
-
})
|
|
178
|
-
.catch(function (error) {
|
|
179
|
-
if (startingUp && retriesOnFailureBeforeReady > retry) {
|
|
180
|
-
retry += 1;
|
|
181
|
-
log.warn(SYNC_SPLITS_FETCH_RETRY, [retry, error]);
|
|
182
|
-
return _splitChangesUpdater(sinces, retry);
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
startingUp = false;
|
|
186
|
-
log.warn(SYNC_SPLITS_FETCH_FAILS, [error]);
|
|
187
|
-
}
|
|
188
|
-
return false;
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
// `getChangeNumber` never rejects or throws error
|
|
192
|
-
return Promise.all([splits.getChangeNumber(), rbSegments.getChangeNumber()]).then(_splitChangesUpdater);
|
|
193
|
-
};
|
|
194
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { FALLBACK_SPLIT_NOT_FOUND, SPLIT_NOT_FOUND } from '../labels';
|
|
2
|
-
import { WARN_NOT_EXISTENT_SPLIT } from '../../logger/constants';
|
|
3
|
-
/**
|
|
4
|
-
* This is defined here and in this format mostly because of the logger and the fact that it's considered a validation at product level.
|
|
5
|
-
* But it's not going to run on the input validation layer. In any case, the most compelling reason to use it as we do is to avoid going to Redis and get a split twice.
|
|
6
|
-
*/
|
|
7
|
-
export function validateSplitExistence(log, readinessManager, splitName, labelOrSplitObj, method) {
|
|
8
|
-
if (readinessManager.isReady()) { // Only if it's ready (synced with BE) we validate this, otherwise it may just be that the SDK is still syncing
|
|
9
|
-
if (labelOrSplitObj === SPLIT_NOT_FOUND || labelOrSplitObj === FALLBACK_SPLIT_NOT_FOUND || labelOrSplitObj == null) {
|
|
10
|
-
log.warn(WARN_NOT_EXISTENT_SPLIT, [method, splitName]);
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ERROR_EMPTY_ARRAY } from '../../logger/constants';
|
|
2
|
-
import { uniq } from '../lang';
|
|
3
|
-
import { validateSplit } from './split';
|
|
4
|
-
export function validateSplits(log, maybeSplits, method, listName, item) {
|
|
5
|
-
if (listName === void 0) { listName = 'feature flag names'; }
|
|
6
|
-
if (item === void 0) { item = 'feature flag name'; }
|
|
7
|
-
if (Array.isArray(maybeSplits) && maybeSplits.length > 0) {
|
|
8
|
-
var validatedArray_1 = [];
|
|
9
|
-
// Remove invalid values
|
|
10
|
-
maybeSplits.forEach(function (maybeSplit) {
|
|
11
|
-
var splitName = validateSplit(log, maybeSplit, method, item);
|
|
12
|
-
if (splitName)
|
|
13
|
-
validatedArray_1.push(splitName);
|
|
14
|
-
});
|
|
15
|
-
// Strip off duplicated values if we have valid split names then return
|
|
16
|
-
if (validatedArray_1.length)
|
|
17
|
-
return uniq(validatedArray_1);
|
|
18
|
-
}
|
|
19
|
-
log.error(ERROR_EMPTY_ARRAY, [method, listName]);
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { IDecodedJWTToken } from '../../../utils/jwt/types';
|
|
2
|
-
|
|
3
|
-
export type IJwtCredential = {
|
|
4
|
-
token: string; // empty string ("") when `"pushEnabled": false`
|
|
5
|
-
decodedToken: IDecodedJWTToken
|
|
6
|
-
channels: { [channel: string]: string[] }
|
|
7
|
-
// /api/v2/auth fields
|
|
8
|
-
pushEnabled?: boolean | null;
|
|
9
|
-
connDelay?: number | null;
|
|
10
|
-
// /api/v3/auth fields
|
|
11
|
-
config?: {
|
|
12
|
-
streaming?: {
|
|
13
|
-
delay?: number | null;
|
|
14
|
-
enabled?: boolean | null;
|
|
15
|
-
} | null;
|
|
16
|
-
} | null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type IFetchAuth = (userKeys?: string[]) => Promise<IJwtCredential>
|