@splitsoftware/splitio-commons 1.16.1-rc.1 → 1.16.1-rc.11

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 (144) hide show
  1. package/CHANGES.txt +4 -0
  2. package/cjs/logger/constants.js +5 -4
  3. package/cjs/logger/messages/info.js +2 -1
  4. package/cjs/logger/messages/warn.js +1 -1
  5. package/cjs/readiness/readinessManager.js +7 -12
  6. package/cjs/services/splitApi.js +5 -9
  7. package/cjs/storages/AbstractSegmentsCacheSync.js +41 -12
  8. package/cjs/storages/AbstractSplitsCacheAsync.js +2 -2
  9. package/cjs/storages/AbstractSplitsCacheSync.js +7 -5
  10. package/cjs/storages/KeyBuilder.js +0 -3
  11. package/cjs/storages/KeyBuilderCS.js +6 -0
  12. package/cjs/storages/dataLoader.js +1 -1
  13. package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +29 -52
  14. package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +4 -16
  15. package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +9 -40
  16. package/cjs/storages/inMemory/SplitsCacheInMemory.js +6 -15
  17. package/cjs/sync/polling/fetchers/mySegmentsFetcher.js +4 -11
  18. package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
  19. package/cjs/sync/polling/pollingManagerCS.js +33 -51
  20. package/cjs/sync/polling/syncTasks/mySegmentsSyncTask.js +2 -2
  21. package/cjs/sync/polling/updaters/mySegmentsUpdater.js +14 -20
  22. package/cjs/sync/streaming/AuthClient/index.js +1 -1
  23. package/cjs/sync/streaming/SSEHandler/index.js +3 -6
  24. package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +15 -9
  25. package/cjs/sync/streaming/constants.js +3 -4
  26. package/cjs/sync/streaming/parseUtils.js +14 -9
  27. package/cjs/sync/streaming/pushManager.js +29 -55
  28. package/cjs/sync/submitters/telemetrySubmitter.js +0 -2
  29. package/cjs/sync/syncManagerOnline.js +14 -24
  30. package/cjs/utils/constants/index.js +4 -5
  31. package/cjs/utils/settingsValidation/index.js +1 -5
  32. package/esm/logger/constants.js +2 -1
  33. package/esm/logger/messages/info.js +2 -1
  34. package/esm/logger/messages/warn.js +1 -1
  35. package/esm/readiness/readinessManager.js +7 -12
  36. package/esm/services/splitApi.js +6 -10
  37. package/esm/storages/AbstractSegmentsCacheSync.js +41 -12
  38. package/esm/storages/AbstractSplitsCacheAsync.js +2 -2
  39. package/esm/storages/AbstractSplitsCacheSync.js +5 -3
  40. package/esm/storages/KeyBuilder.js +0 -3
  41. package/esm/storages/KeyBuilderCS.js +6 -0
  42. package/esm/storages/dataLoader.js +1 -1
  43. package/esm/storages/inLocalStorage/MySegmentsCacheInLocal.js +29 -52
  44. package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +5 -17
  45. package/esm/storages/inMemory/MySegmentsCacheInMemory.js +9 -40
  46. package/esm/storages/inMemory/SplitsCacheInMemory.js +7 -16
  47. package/esm/sync/polling/fetchers/mySegmentsFetcher.js +4 -11
  48. package/esm/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
  49. package/esm/sync/polling/pollingManagerCS.js +34 -52
  50. package/esm/sync/polling/syncTasks/mySegmentsSyncTask.js +2 -2
  51. package/esm/sync/polling/updaters/mySegmentsUpdater.js +12 -18
  52. package/esm/sync/streaming/AuthClient/index.js +1 -1
  53. package/esm/sync/streaming/SSEHandler/index.js +4 -7
  54. package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +15 -9
  55. package/esm/sync/streaming/constants.js +2 -3
  56. package/esm/sync/streaming/parseUtils.js +12 -8
  57. package/esm/sync/streaming/pushManager.js +32 -57
  58. package/esm/sync/submitters/telemetrySubmitter.js +0 -2
  59. package/esm/sync/syncManagerOnline.js +15 -25
  60. package/esm/utils/constants/index.js +2 -3
  61. package/esm/utils/settingsValidation/index.js +1 -5
  62. package/package.json +1 -1
  63. package/src/dtos/types.ts +7 -8
  64. package/src/logger/constants.ts +2 -1
  65. package/src/logger/messages/info.ts +2 -1
  66. package/src/logger/messages/warn.ts +1 -1
  67. package/src/readiness/readinessManager.ts +7 -9
  68. package/src/readiness/types.ts +0 -1
  69. package/src/services/splitApi.ts +7 -12
  70. package/src/services/splitHttpClient.ts +1 -1
  71. package/src/services/types.ts +2 -3
  72. package/src/storages/AbstractSegmentsCacheSync.ts +53 -12
  73. package/src/storages/AbstractSplitsCacheAsync.ts +2 -2
  74. package/src/storages/AbstractSplitsCacheSync.ts +7 -5
  75. package/src/storages/KeyBuilder.ts +0 -3
  76. package/src/storages/KeyBuilderCS.ts +9 -0
  77. package/src/storages/dataLoader.ts +1 -1
  78. package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +26 -56
  79. package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +5 -20
  80. package/src/storages/inMemory/MySegmentsCacheInMemory.ts +10 -44
  81. package/src/storages/inMemory/SplitsCacheInMemory.ts +7 -13
  82. package/src/storages/types.ts +10 -8
  83. package/src/sync/polling/fetchers/mySegmentsFetcher.ts +7 -14
  84. package/src/sync/polling/fetchers/segmentChangesFetcher.ts +1 -1
  85. package/src/sync/polling/fetchers/types.ts +2 -2
  86. package/src/sync/polling/pollingManagerCS.ts +29 -61
  87. package/src/sync/polling/syncTasks/mySegmentsSyncTask.ts +12 -13
  88. package/src/sync/polling/types.ts +8 -8
  89. package/src/sync/polling/updaters/mySegmentsUpdater.ts +17 -18
  90. package/src/sync/streaming/AuthClient/index.ts +1 -1
  91. package/src/sync/streaming/SSEClient/index.ts +4 -6
  92. package/src/sync/streaming/SSEHandler/index.ts +5 -9
  93. package/src/sync/streaming/SSEHandler/types.ts +13 -25
  94. package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +17 -12
  95. package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +1 -1
  96. package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +1 -1
  97. package/src/sync/streaming/UpdateWorkers/types.ts +2 -2
  98. package/src/sync/streaming/constants.ts +2 -3
  99. package/src/sync/streaming/parseUtils.ts +19 -11
  100. package/src/sync/streaming/pushManager.ts +38 -68
  101. package/src/sync/streaming/types.ts +11 -13
  102. package/src/sync/submitters/telemetrySubmitter.ts +0 -2
  103. package/src/sync/submitters/types.ts +3 -6
  104. package/src/sync/syncManagerOnline.ts +11 -19
  105. package/src/types.ts +1 -26
  106. package/src/utils/constants/index.ts +2 -3
  107. package/src/utils/settingsValidation/index.ts +1 -5
  108. package/types/dtos/types.d.ts +7 -8
  109. package/types/logger/constants.d.ts +2 -1
  110. package/types/readiness/types.d.ts +0 -1
  111. package/types/services/decorateHeaders.d.ts +2 -0
  112. package/types/services/splitApi.d.ts +1 -1
  113. package/types/services/splitHttpClient.d.ts +1 -1
  114. package/types/services/types.d.ts +2 -3
  115. package/types/storages/AbstractSegmentsCacheSync.d.ts +9 -11
  116. package/types/storages/AbstractSplitsCacheAsync.d.ts +1 -1
  117. package/types/storages/AbstractSplitsCacheSync.d.ts +4 -4
  118. package/types/storages/KeyBuilder.d.ts +0 -1
  119. package/types/storages/KeyBuilderCS.d.ts +2 -0
  120. package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +2 -12
  121. package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +1 -1
  122. package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +3 -9
  123. package/types/storages/inMemory/SplitsCacheInMemory.d.ts +1 -2
  124. package/types/storages/types.d.ts +8 -7
  125. package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +2 -2
  126. package/types/sync/polling/fetchers/types.d.ts +2 -2
  127. package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +4 -3
  128. package/types/sync/polling/types.d.ts +8 -12
  129. package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +3 -2
  130. package/types/sync/streaming/SSEHandler/types.d.ts +13 -22
  131. package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +2 -3
  132. package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +2 -1
  133. package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +3 -2
  134. package/types/sync/streaming/UpdateWorkers/types.d.ts +2 -2
  135. package/types/sync/streaming/constants.d.ts +2 -3
  136. package/types/sync/streaming/parseUtils.d.ts +4 -5
  137. package/types/sync/streaming/pushManager.d.ts +0 -2
  138. package/types/sync/streaming/pushManagerCS_Spec1_3.d.ts +9 -0
  139. package/types/sync/streaming/pushManager_Spec1_3.d.ts +9 -0
  140. package/types/sync/streaming/types.d.ts +9 -10
  141. package/types/sync/submitters/types.d.ts +3 -6
  142. package/types/types.d.ts +0 -25
  143. package/types/utils/constants/index.d.ts +2 -3
  144. package/types/utils/settingsValidation/index.d.ts +0 -2
package/types/types.d.ts CHANGED
@@ -80,7 +80,6 @@ export interface ISettings {
80
80
  metricsRefreshRate?: number;
81
81
  telemetryRefreshRate: number;
82
82
  segmentsRefreshRate: number;
83
- largeSegmentsRefreshRate: number;
84
83
  offlineRefreshRate: number;
85
84
  eventsPushRate: number;
86
85
  eventsQueueSize: number;
@@ -91,7 +90,6 @@ export interface ISettings {
91
90
  requestTimeoutBeforeReady: number;
92
91
  retriesOnFailureBeforeReady: number;
93
92
  eventsFirstPushWindow: number;
94
- waitForLargeSegments: boolean;
95
93
  };
96
94
  readonly storage: IStorageSyncFactory | IStorageAsyncFactory;
97
95
  readonly integrations: Array<{
@@ -115,7 +113,6 @@ export interface ISettings {
115
113
  __splitFiltersValidation: ISplitFiltersValidation;
116
114
  localhostMode?: SplitIO.LocalhostFactory;
117
115
  enabled: boolean;
118
- largeSegmentsEnabled: boolean;
119
116
  flagSpecVersion: string;
120
117
  };
121
118
  readonly runtime: {
@@ -813,13 +810,6 @@ export declare namespace SplitIO {
813
810
  * @default 10
814
811
  */
815
812
  eventsFirstPushWindow?: number;
816
- /**
817
- * Whether the SDK should wait for large segments to be ready before emitting SDK_READY event.
818
- * It only applies if largeSegmentsEnabled is true.
819
- * @property {number} waitForLargeSegments
820
- * @default true
821
- */
822
- waitForLargeSegments?: boolean;
823
813
  };
824
814
  /**
825
815
  * SDK scheduler settings.
@@ -864,13 +854,6 @@ export declare namespace SplitIO {
864
854
  * @default 60
865
855
  */
866
856
  segmentsRefreshRate?: number;
867
- /**
868
- * The SDK polls Split servers for changes to large segment definitions. This parameter controls this polling period in seconds.
869
- * It only applies if largeSegmentsEnabled is true.
870
- * @property {number} largeSegmentsRefreshRate
871
- * @default 60
872
- */
873
- largeSegmentsRefreshRate?: number;
874
857
  /**
875
858
  * The SDK posts the queued events data in bulks. This parameter controls the posting rate in seconds.
876
859
  * @property {number} eventsPushRate
@@ -943,14 +926,6 @@ export declare namespace SplitIO {
943
926
  * @property {Object} urls
944
927
  */
945
928
  urls?: UrlSettings;
946
- sync?: ISharedSettings['sync'] & {
947
- /**
948
- * Enables synchronization of large segments.
949
- * @property {boolean} largeSegmentsEnabled
950
- * @default false
951
- */
952
- largeSegmentsEnabled?: boolean;
953
- };
954
929
  }
955
930
  /**
956
931
  * Settings interface for SDK instances created on NodeJS.
@@ -52,8 +52,7 @@ export declare const EVENTS = "ev";
52
52
  export declare const TELEMETRY = "te";
53
53
  export declare const TOKEN = "to";
54
54
  export declare const SEGMENT = "se";
55
- export declare const MY_SEGMENT = "ms";
56
- export declare const MY_LARGE_SEGMENT = "mls";
55
+ export declare const MEMBERSHIPS = "ms";
57
56
  export declare const TREATMENT = "t";
58
57
  export declare const TREATMENTS = "ts";
59
58
  export declare const TREATMENT_WITH_CONFIG = "tc";
@@ -79,6 +78,6 @@ export declare const NON_REQUESTED = 1;
79
78
  export declare const DISABLED = 0;
80
79
  export declare const ENABLED = 1;
81
80
  export declare const PAUSED = 2;
82
- export declare const FLAG_SPEC_VERSION = "1.1";
81
+ export declare const FLAG_SPEC_VERSION = "1.2";
83
82
  export declare const IN_SEGMENT = "IN_SEGMENT";
84
83
  export declare const IN_LARGE_SEGMENT = "IN_LARGE_SEGMENT";
@@ -12,7 +12,6 @@ export declare const base: {
12
12
  scheduler: {
13
13
  featuresRefreshRate: number;
14
14
  segmentsRefreshRate: number;
15
- largeSegmentsRefreshRate: number;
16
15
  telemetryRefreshRate: number;
17
16
  impressionsRefreshRate: number;
18
17
  offlineRefreshRate: number;
@@ -40,7 +39,6 @@ export declare const base: {
40
39
  localhostMode: undefined;
41
40
  enabled: boolean;
42
41
  flagSpecVersion: string;
43
- largeSegmentsEnabled: boolean;
44
42
  };
45
43
  log: undefined;
46
44
  };