@splitsoftware/splitio-commons 1.17.1-rc.1 → 1.17.1-rc.2

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 (41) hide show
  1. package/CHANGES.txt +1 -0
  2. package/cjs/sdkFactory/index.js +3 -1
  3. package/cjs/storages/AbstractSplitsCacheAsync.js +0 -7
  4. package/cjs/storages/AbstractSplitsCacheSync.js +0 -7
  5. package/cjs/storages/dataLoader.js +65 -32
  6. package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +1 -9
  7. package/cjs/storages/inLocalStorage/index.js +4 -1
  8. package/cjs/storages/inMemory/InMemoryStorageCS.js +16 -4
  9. package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +2 -7
  10. package/cjs/sync/polling/updaters/splitChangesUpdater.js +1 -10
  11. package/cjs/utils/settingsValidation/storage/storageCS.js +1 -12
  12. package/esm/sdkFactory/index.js +4 -2
  13. package/esm/storages/AbstractSplitsCacheAsync.js +0 -7
  14. package/esm/storages/AbstractSplitsCacheSync.js +0 -7
  15. package/esm/storages/dataLoader.js +62 -30
  16. package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +1 -9
  17. package/esm/storages/inLocalStorage/index.js +5 -2
  18. package/esm/storages/inMemory/InMemoryStorageCS.js +16 -4
  19. package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +3 -8
  20. package/esm/sync/polling/updaters/splitChangesUpdater.js +2 -11
  21. package/esm/utils/settingsValidation/storage/storageCS.js +0 -10
  22. package/package.json +1 -1
  23. package/src/sdkFactory/index.ts +5 -2
  24. package/src/storages/AbstractSplitsCacheAsync.ts +0 -8
  25. package/src/storages/AbstractSplitsCacheSync.ts +0 -8
  26. package/src/storages/dataLoader.ts +63 -32
  27. package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +1 -10
  28. package/src/storages/inLocalStorage/index.ts +6 -2
  29. package/src/storages/inMemory/InMemoryStorageCS.ts +19 -4
  30. package/src/storages/types.ts +1 -6
  31. package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +3 -7
  32. package/src/sync/polling/updaters/splitChangesUpdater.ts +3 -11
  33. package/src/types.ts +9 -8
  34. package/src/utils/settingsValidation/storage/storageCS.ts +0 -13
  35. package/types/storages/AbstractSplitsCacheAsync.d.ts +0 -5
  36. package/types/storages/AbstractSplitsCacheSync.d.ts +0 -5
  37. package/types/storages/dataLoader.d.ts +17 -6
  38. package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +0 -6
  39. package/types/storages/types.d.ts +1 -4
  40. package/types/types.d.ts +8 -8
  41. package/types/utils/settingsValidation/storage/storageCS.d.ts +0 -5
package/types/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ISplitFiltersValidation } from './dtos/types';
1
+ import { ISplit, ISplitFiltersValidation } from './dtos/types';
2
2
  import { IIntegration, IIntegrationFactoryParams } from './integrations/types';
3
3
  import { ILogger } from './logger/types';
4
4
  import { ISdkFactoryContext } from './sdkFactory/types';
@@ -92,6 +92,7 @@ export interface ISettings {
92
92
  eventsFirstPushWindow: number;
93
93
  };
94
94
  readonly storage: IStorageSyncFactory | IStorageAsyncFactory;
95
+ readonly preloadedData?: SplitIO.PreloadedData;
95
96
  readonly integrations: Array<{
96
97
  readonly type: string;
97
98
  (params: IIntegrationFactoryParams): IIntegration | void;
@@ -770,21 +771,19 @@ export declare namespace SplitIO {
770
771
  * If this value is older than 10 days ago (expiration time policy), the data is not used to update the storage content.
771
772
  * @TODO configurable expiration time policy?
772
773
  */
773
- lastUpdated: number;
774
774
  /**
775
775
  * Change number of the preloaded data.
776
776
  * If this value is older than the current changeNumber at the storage, the data is not used to update the storage content.
777
777
  */
778
778
  since: number;
779
779
  /**
780
- * Map of feature flags to their stringified definitions.
780
+ * List of feature flag definitions.
781
+ * @TODO rename to flags
781
782
  */
782
- splitsData: {
783
- [splitName: string]: string;
784
- };
783
+ splitsData: ISplit[];
785
784
  /**
786
785
  * Optional map of user keys to their list of segments.
787
- * @TODO remove when releasing first version
786
+ * @TODO rename to memberships
788
787
  */
789
788
  mySegmentsData?: {
790
789
  [key: string]: string[];
@@ -792,9 +791,10 @@ export declare namespace SplitIO {
792
791
  /**
793
792
  * Optional map of segments to their stringified definitions.
794
793
  * This property is ignored if `mySegmentsData` was provided.
794
+ * @TODO rename to segments
795
795
  */
796
796
  segmentsData?: {
797
- [segmentName: string]: string;
797
+ [segmentName: string]: string[];
798
798
  };
799
799
  }
800
800
  /**
@@ -1,10 +1,5 @@
1
1
  import { ISettings, SDKMode } from '../../../types';
2
2
  import { ILogger } from '../../../logger/types';
3
- import { IStorageFactoryParams, IStorageSync } from '../../../storages/types';
4
- export declare function __InLocalStorageMockFactory(params: IStorageFactoryParams): IStorageSync;
5
- export declare namespace __InLocalStorageMockFactory {
6
- var type: import("../../../storages/types").StorageType;
7
- }
8
3
  /**
9
4
  * This function validates `settings.storage` object
10
5
  *