@splitsoftware/splitio-commons 1.2.1-rc.3 → 1.2.1-rc.6
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/cjs/listeners/browser.js +14 -10
- package/cjs/logger/constants.js +7 -4
- package/cjs/logger/messages/debug.js +3 -3
- package/cjs/logger/messages/error.js +3 -2
- package/cjs/logger/messages/info.js +5 -3
- package/cjs/sdkClient/client.js +10 -4
- package/cjs/sdkFactory/index.js +6 -4
- package/cjs/sdkFactory/userConsentProps.js +37 -0
- package/cjs/storages/KeyBuilder.js +1 -5
- package/cjs/storages/KeyBuilderCS.js +11 -1
- package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +23 -3
- package/cjs/storages/inLocalStorage/index.js +1 -1
- package/cjs/storages/inMemory/ImpressionsCacheInMemory.js +15 -1
- package/cjs/storages/inMemory/InMemoryStorage.js +1 -1
- package/cjs/storages/inMemory/InMemoryStorageCS.js +1 -1
- package/cjs/storages/pluggable/index.js +2 -2
- package/cjs/sync/submitters/eventsSyncTask.js +17 -5
- package/cjs/sync/submitters/impressionsSyncTask.js +13 -1
- package/cjs/sync/syncManagerOnline.js +11 -7
- package/cjs/utils/consent.js +10 -0
- package/cjs/utils/constants/index.js +5 -1
- package/cjs/utils/lang/index.js +8 -1
- package/cjs/utils/settingsValidation/consent.js +16 -0
- package/cjs/utils/settingsValidation/impressionsMode.js +6 -6
- package/cjs/utils/settingsValidation/index.js +6 -1
- package/cjs/utils/settingsValidation/{runtime/browser.js → runtime.js} +1 -0
- package/esm/listeners/browser.js +14 -10
- package/esm/logger/constants.js +5 -2
- package/esm/logger/messages/debug.js +3 -3
- package/esm/logger/messages/error.js +3 -2
- package/esm/logger/messages/info.js +5 -3
- package/esm/sdkClient/client.js +11 -5
- package/esm/sdkFactory/index.js +6 -4
- package/esm/sdkFactory/userConsentProps.js +33 -0
- package/esm/storages/KeyBuilder.js +2 -6
- package/esm/storages/KeyBuilderCS.js +11 -1
- package/esm/storages/inLocalStorage/MySegmentsCacheInLocal.js +23 -3
- package/esm/storages/inLocalStorage/index.js +1 -1
- package/esm/storages/inMemory/ImpressionsCacheInMemory.js +15 -1
- package/esm/storages/inMemory/InMemoryStorage.js +1 -1
- package/esm/storages/inMemory/InMemoryStorageCS.js +1 -1
- package/esm/storages/pluggable/index.js +2 -2
- package/esm/sync/submitters/eventsSyncTask.js +18 -6
- package/esm/sync/submitters/impressionsSyncTask.js +13 -1
- package/esm/sync/syncManagerOnline.js +11 -7
- package/esm/utils/consent.js +6 -0
- package/esm/utils/constants/index.js +4 -0
- package/esm/utils/lang/index.js +6 -0
- package/esm/utils/settingsValidation/consent.js +12 -0
- package/esm/utils/settingsValidation/impressionsMode.js +7 -7
- package/esm/utils/settingsValidation/index.js +6 -1
- package/esm/utils/settingsValidation/{runtime/browser.js → runtime.js} +1 -0
- package/package.json +1 -2
- package/src/listeners/browser.ts +13 -9
- package/src/logger/constants.ts +5 -2
- package/src/logger/messages/debug.ts +3 -3
- package/src/logger/messages/error.ts +3 -2
- package/src/logger/messages/info.ts +5 -3
- package/src/sdkClient/client.ts +7 -5
- package/src/sdkFactory/index.ts +6 -4
- package/src/sdkFactory/types.ts +2 -0
- package/src/sdkFactory/userConsentProps.ts +40 -0
- package/src/storages/KeyBuilder.ts +2 -6
- package/src/storages/KeyBuilderCS.ts +13 -1
- package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +23 -3
- package/src/storages/inLocalStorage/index.ts +1 -1
- package/src/storages/inMemory/ImpressionsCacheInMemory.ts +22 -1
- package/src/storages/inMemory/InMemoryStorage.ts +1 -1
- package/src/storages/inMemory/InMemoryStorageCS.ts +1 -1
- package/src/storages/pluggable/index.ts +2 -2
- package/src/storages/types.ts +5 -1
- package/src/sync/submitters/eventsSyncTask.ts +19 -6
- package/src/sync/submitters/impressionsSyncTask.ts +16 -1
- package/src/sync/syncManagerOnline.ts +13 -7
- package/src/sync/types.ts +4 -1
- package/src/types.ts +21 -0
- package/src/utils/consent.ts +8 -0
- package/src/utils/constants/index.ts +5 -0
- package/src/utils/lang/index.ts +8 -1
- package/src/utils/settingsValidation/consent.ts +15 -0
- package/src/utils/settingsValidation/impressionsMode.ts +8 -8
- package/src/utils/settingsValidation/index.ts +7 -1
- package/src/utils/settingsValidation/runtime.ts +9 -0
- package/src/utils/settingsValidation/types.ts +2 -0
- package/types/logger/constants.d.ts +5 -2
- package/types/sdkFactory/types.d.ts +1 -0
- package/types/sdkFactory/userConsentProps.d.ts +6 -0
- package/types/storages/KeyBuilderCS.d.ts +2 -0
- package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +9 -0
- package/types/storages/types.d.ts +2 -0
- package/types/sync/types.d.ts +3 -0
- package/types/types.d.ts +21 -0
- package/types/utils/consent.d.ts +2 -0
- package/types/utils/constants/index.d.ts +3 -0
- package/types/utils/lang/index.d.ts +4 -0
- package/types/utils/settingsValidation/consent.d.ts +5 -0
- package/types/utils/settingsValidation/impressionsMode.d.ts +1 -1
- package/types/utils/settingsValidation/runtime.d.ts +2 -0
- package/types/utils/settingsValidation/types.d.ts +2 -0
- package/types/utils/settingsValidation/userConsent.d.ts +5 -0
- package/cjs/utils/settingsValidation/runtime/node.js +0 -22
- package/esm/utils/settingsValidation/runtime/node.js +0 -17
- package/src/utils/settingsValidation/runtime/browser.ts +0 -8
- package/src/utils/settingsValidation/runtime/node.ts +0 -22
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import osFunction from 'os';
|
|
2
|
-
import ipFunction from 'ip';
|
|
3
|
-
import { UNKNOWN, NA, CONSUMER_MODE } from '../../constants';
|
|
4
|
-
export function validateRuntime(settings) {
|
|
5
|
-
var isIPAddressesEnabled = settings.core.IPAddressesEnabled === true;
|
|
6
|
-
var isConsumerMode = settings.mode === CONSUMER_MODE;
|
|
7
|
-
// If the values are not available, default to false (for standalone) or "unknown" (for consumer mode, to be used on Redis keys)
|
|
8
|
-
var ip = ipFunction.address() || (isConsumerMode ? UNKNOWN : false);
|
|
9
|
-
var hostname = osFunction.hostname() || (isConsumerMode ? UNKNOWN : false);
|
|
10
|
-
if (!isIPAddressesEnabled) { // If IPAddresses setting is not enabled, set as false (for standalone) or "NA" (for consumer mode, to be used on Redis keys)
|
|
11
|
-
ip = hostname = isConsumerMode ? NA : false;
|
|
12
|
-
}
|
|
13
|
-
return {
|
|
14
|
-
ip: ip,
|
|
15
|
-
hostname: hostname
|
|
16
|
-
};
|
|
17
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import osFunction from 'os';
|
|
2
|
-
import ipFunction from 'ip';
|
|
3
|
-
|
|
4
|
-
import { UNKNOWN, NA, CONSUMER_MODE } from '../../constants';
|
|
5
|
-
import { ISettings } from '../../../types';
|
|
6
|
-
|
|
7
|
-
export function validateRuntime(settings: ISettings): ISettings['runtime'] {
|
|
8
|
-
const isIPAddressesEnabled = settings.core.IPAddressesEnabled === true;
|
|
9
|
-
const isConsumerMode = settings.mode === CONSUMER_MODE;
|
|
10
|
-
|
|
11
|
-
// If the values are not available, default to false (for standalone) or "unknown" (for consumer mode, to be used on Redis keys)
|
|
12
|
-
let ip = ipFunction.address() || (isConsumerMode ? UNKNOWN : false);
|
|
13
|
-
let hostname = osFunction.hostname() || (isConsumerMode ? UNKNOWN : false);
|
|
14
|
-
|
|
15
|
-
if (!isIPAddressesEnabled) { // If IPAddresses setting is not enabled, set as false (for standalone) or "NA" (for consumer mode, to be used on Redis keys)
|
|
16
|
-
ip = hostname = isConsumerMode ? NA : false;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
ip, hostname
|
|
21
|
-
};
|
|
22
|
-
}
|