@splitsoftware/splitio-commons 1.5.1-rc.0 → 1.5.1-rc.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/CHANGES.txt +1 -2
- package/cjs/integrations/ga/GaToSplit.js +11 -12
- package/cjs/services/splitApi.js +4 -4
- package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +5 -5
- package/cjs/sync/polling/fetchers/splitChangesFetcher.js +2 -2
- package/cjs/sync/polling/updaters/segmentChangesUpdater.js +34 -34
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +4 -3
- package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +46 -46
- package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +82 -64
- package/cjs/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +74 -58
- package/cjs/sync/streaming/UpdateWorkers/constants.js +6 -0
- package/cjs/sync/streaming/pushManager.js +6 -7
- package/cjs/sync/syncTask.js +13 -16
- package/cjs/utils/Backoff.js +3 -2
- package/esm/integrations/ga/GaToSplit.js +11 -12
- package/esm/services/splitApi.js +4 -4
- package/esm/sync/polling/fetchers/segmentChangesFetcher.js +5 -5
- package/esm/sync/polling/fetchers/splitChangesFetcher.js +2 -2
- package/esm/sync/polling/updaters/segmentChangesUpdater.js +34 -34
- package/esm/sync/polling/updaters/splitChangesUpdater.js +4 -3
- package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +46 -47
- package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +82 -65
- package/esm/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +74 -59
- package/esm/sync/streaming/UpdateWorkers/constants.js +3 -0
- package/esm/sync/streaming/pushManager.js +6 -7
- package/esm/sync/syncTask.js +13 -16
- package/esm/utils/Backoff.js +3 -2
- package/package.json +1 -1
- package/src/integrations/ga/GaToSplit.ts +8 -14
- package/src/integrations/ga/types.ts +2 -13
- package/src/services/splitApi.ts +4 -4
- package/src/services/types.ts +2 -2
- package/src/sync/polling/fetchers/segmentChangesFetcher.ts +5 -4
- package/src/sync/polling/fetchers/splitChangesFetcher.ts +2 -1
- package/src/sync/polling/fetchers/types.ts +2 -0
- package/src/sync/polling/pollingManagerCS.ts +5 -5
- package/src/sync/polling/syncTasks/mySegmentsSyncTask.ts +2 -2
- package/src/sync/polling/types.ts +14 -6
- package/src/sync/polling/updaters/mySegmentsUpdater.ts +4 -4
- package/src/sync/polling/updaters/segmentChangesUpdater.ts +34 -32
- package/src/sync/polling/updaters/splitChangesUpdater.ts +5 -4
- package/src/sync/streaming/SSEHandler/types.ts +0 -7
- package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +45 -54
- package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +78 -63
- package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +73 -61
- package/src/sync/streaming/UpdateWorkers/constants.ts +3 -0
- package/src/sync/streaming/UpdateWorkers/types.ts +2 -4
- package/src/sync/streaming/pushManager.ts +12 -12
- package/src/sync/streaming/types.ts +2 -2
- package/src/sync/syncTask.ts +16 -18
- package/src/utils/Backoff.ts +7 -2
- package/types/integrations/ga/types.d.ts +2 -13
- package/types/services/types.d.ts +2 -2
- package/types/sync/polling/fetchers/types.d.ts +2 -2
- package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +2 -2
- package/types/sync/polling/types.d.ts +11 -6
- package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +1 -1
- package/types/sync/polling/updaters/splitChangesUpdater.d.ts +1 -1
- package/types/sync/streaming/SSEHandler/types.d.ts +0 -4
- package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +3 -24
- package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +3 -23
- package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +6 -33
- package/types/sync/streaming/UpdateWorkers/types.d.ts +1 -2
- package/types/sync/streaming/types.d.ts +2 -2
- package/types/sync/syncTask.d.ts +2 -3
- package/types/utils/Backoff.d.ts +2 -0
- package/src/integrations/ga/autoRequire.js +0 -33
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IMySegmentsUpdateData, IMySegmentsUpdateV2Data, ISegmentUpdateData, ISplitUpdateData, ISplitKillData } from './SSEHandler/types';
|
|
2
2
|
import { ITask } from '../types';
|
|
3
|
-
import {
|
|
3
|
+
import { IMySegmentsSyncTask } from '../polling/types';
|
|
4
4
|
import { IEventEmitter } from '../../types';
|
|
5
5
|
import { ControlType } from './constants';
|
|
6
6
|
export declare type PUSH_SUBSYSTEM_UP = 'PUSH_SUBSYSTEM_UP';
|
|
@@ -29,7 +29,7 @@ export interface IPushEventEmitter extends IEventEmitter {
|
|
|
29
29
|
* PushManager
|
|
30
30
|
*/
|
|
31
31
|
export interface IPushManager extends ITask, IPushEventEmitter {
|
|
32
|
-
add(userKey: string, mySegmentsSyncTask:
|
|
32
|
+
add(userKey: string, mySegmentsSyncTask: IMySegmentsSyncTask): void;
|
|
33
33
|
remove(userKey: string): void;
|
|
34
34
|
}
|
|
35
35
|
export {};
|
package/types/sync/syncTask.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ILogger } from '../logger/types';
|
|
2
2
|
import { ISyncTask } from './types';
|
|
3
3
|
/**
|
|
4
|
-
* Creates
|
|
5
|
-
* The task can be also executed by calling the "execute" method. Multiple
|
|
6
|
-
* For example, submitters executed on SDK destroy or full queue, while periodic execution is pending.
|
|
4
|
+
* Creates an object that handles the periodic execution of a given task via "start" and "stop" methods.
|
|
5
|
+
* The task can be also executed by calling the "execute" method. Multiple calls run sequentially to avoid race conditions (e.g., submitters executed on SDK destroy or full queue, while periodic execution is pending).
|
|
7
6
|
*
|
|
8
7
|
* @param log Logger instance.
|
|
9
8
|
* @param task Task to execute that returns a promise that NEVER REJECTS. Otherwise, periodic execution can result in Unhandled Promise Rejections.
|
package/types/utils/Backoff.d.ts
CHANGED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
/**
|
|
3
|
-
* Auto-require script to use with GoogleAnalyticsToSplit integration
|
|
4
|
-
*/
|
|
5
|
-
(function (i, r, s) {
|
|
6
|
-
i[s] = i[s] || r;
|
|
7
|
-
i[r] = i[r] || function () { i[r].q.push(arguments); };
|
|
8
|
-
i[r].q = i[r].q || [];
|
|
9
|
-
|
|
10
|
-
var ts = {}; // Tracker names
|
|
11
|
-
function name(arg) { return typeof arg === 'object' && typeof arg.name === 'string' && arg.name; }
|
|
12
|
-
|
|
13
|
-
function processCommand(v) { // Queue a `require` command if v is a `create` command
|
|
14
|
-
if (v && v[0] === 'create') {
|
|
15
|
-
var t = name(v[1]) || name(v[2]) || name(v[3]) || (typeof v[3] === 'string' ? v[3] : undefined); // Get tracker name
|
|
16
|
-
|
|
17
|
-
if (!ts[t]) {
|
|
18
|
-
ts[t] = true;
|
|
19
|
-
i[r]((t ? t + '.' : '') + 'require', 'splitTracker'); // Auto-require
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
i[r].q.forEach(processCommand); // Process already queued commands
|
|
25
|
-
|
|
26
|
-
var o = i[r].q.push;
|
|
27
|
-
i[r].q.push = function (v) { // Spy new queued commands
|
|
28
|
-
var result = o.apply(this, arguments);
|
|
29
|
-
processCommand(v);
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
})(window, 'ga', 'GoogleAnalyticsObject');
|