@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.
Files changed (67) hide show
  1. package/CHANGES.txt +1 -2
  2. package/cjs/integrations/ga/GaToSplit.js +11 -12
  3. package/cjs/services/splitApi.js +4 -4
  4. package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +5 -5
  5. package/cjs/sync/polling/fetchers/splitChangesFetcher.js +2 -2
  6. package/cjs/sync/polling/updaters/segmentChangesUpdater.js +34 -34
  7. package/cjs/sync/polling/updaters/splitChangesUpdater.js +4 -3
  8. package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +46 -46
  9. package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +82 -64
  10. package/cjs/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +74 -58
  11. package/cjs/sync/streaming/UpdateWorkers/constants.js +6 -0
  12. package/cjs/sync/streaming/pushManager.js +6 -7
  13. package/cjs/sync/syncTask.js +13 -16
  14. package/cjs/utils/Backoff.js +3 -2
  15. package/esm/integrations/ga/GaToSplit.js +11 -12
  16. package/esm/services/splitApi.js +4 -4
  17. package/esm/sync/polling/fetchers/segmentChangesFetcher.js +5 -5
  18. package/esm/sync/polling/fetchers/splitChangesFetcher.js +2 -2
  19. package/esm/sync/polling/updaters/segmentChangesUpdater.js +34 -34
  20. package/esm/sync/polling/updaters/splitChangesUpdater.js +4 -3
  21. package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +46 -47
  22. package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +82 -65
  23. package/esm/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +74 -59
  24. package/esm/sync/streaming/UpdateWorkers/constants.js +3 -0
  25. package/esm/sync/streaming/pushManager.js +6 -7
  26. package/esm/sync/syncTask.js +13 -16
  27. package/esm/utils/Backoff.js +3 -2
  28. package/package.json +1 -1
  29. package/src/integrations/ga/GaToSplit.ts +8 -14
  30. package/src/integrations/ga/types.ts +2 -13
  31. package/src/services/splitApi.ts +4 -4
  32. package/src/services/types.ts +2 -2
  33. package/src/sync/polling/fetchers/segmentChangesFetcher.ts +5 -4
  34. package/src/sync/polling/fetchers/splitChangesFetcher.ts +2 -1
  35. package/src/sync/polling/fetchers/types.ts +2 -0
  36. package/src/sync/polling/pollingManagerCS.ts +5 -5
  37. package/src/sync/polling/syncTasks/mySegmentsSyncTask.ts +2 -2
  38. package/src/sync/polling/types.ts +14 -6
  39. package/src/sync/polling/updaters/mySegmentsUpdater.ts +4 -4
  40. package/src/sync/polling/updaters/segmentChangesUpdater.ts +34 -32
  41. package/src/sync/polling/updaters/splitChangesUpdater.ts +5 -4
  42. package/src/sync/streaming/SSEHandler/types.ts +0 -7
  43. package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +45 -54
  44. package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +78 -63
  45. package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +73 -61
  46. package/src/sync/streaming/UpdateWorkers/constants.ts +3 -0
  47. package/src/sync/streaming/UpdateWorkers/types.ts +2 -4
  48. package/src/sync/streaming/pushManager.ts +12 -12
  49. package/src/sync/streaming/types.ts +2 -2
  50. package/src/sync/syncTask.ts +16 -18
  51. package/src/utils/Backoff.ts +7 -2
  52. package/types/integrations/ga/types.d.ts +2 -13
  53. package/types/services/types.d.ts +2 -2
  54. package/types/sync/polling/fetchers/types.d.ts +2 -2
  55. package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +2 -2
  56. package/types/sync/polling/types.d.ts +11 -6
  57. package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +1 -1
  58. package/types/sync/polling/updaters/splitChangesUpdater.d.ts +1 -1
  59. package/types/sync/streaming/SSEHandler/types.d.ts +0 -4
  60. package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +3 -24
  61. package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +3 -23
  62. package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +6 -33
  63. package/types/sync/streaming/UpdateWorkers/types.d.ts +1 -2
  64. package/types/sync/streaming/types.d.ts +2 -2
  65. package/types/sync/syncTask.d.ts +2 -3
  66. package/types/utils/Backoff.d.ts +2 -0
  67. 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 { ISegmentsSyncTask } from '../polling/types';
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: ISegmentsSyncTask): void;
32
+ add(userKey: string, mySegmentsSyncTask: IMySegmentsSyncTask): void;
33
33
  remove(userKey: string): void;
34
34
  }
35
35
  export {};
@@ -1,9 +1,8 @@
1
1
  import { ILogger } from '../logger/types';
2
2
  import { ISyncTask } from './types';
3
3
  /**
4
- * Creates a syncTask that handles the periodic execution of a given task ("start" and "stop" methods).
5
- * The task can be also executed by calling the "execute" method. Multiple execute calls are chained to run secuentially and avoid race conditions.
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.
@@ -1,4 +1,6 @@
1
1
  export declare class Backoff {
2
+ static __TEST__BASE_MILLIS?: number;
3
+ static __TEST__MAX_MILLIS?: number;
2
4
  static DEFAULT_BASE_MILLIS: number;
3
5
  static DEFAULT_MAX_MILLIS: number;
4
6
  baseMillis: number;
@@ -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');