@splitsoftware/splitio-commons 1.2.1-rc.1 → 1.2.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 (156) hide show
  1. package/cjs/evaluator/Engine.js +6 -6
  2. package/cjs/evaluator/combiners/and.js +1 -1
  3. package/cjs/evaluator/combiners/ifelseif.js +2 -2
  4. package/cjs/evaluator/condition/engineUtils.js +2 -2
  5. package/cjs/evaluator/condition/index.js +4 -4
  6. package/cjs/evaluator/index.js +5 -5
  7. package/cjs/evaluator/matchers/cont_all.js +1 -1
  8. package/cjs/evaluator/matchers/cont_any.js +1 -1
  9. package/cjs/evaluator/matchers/cont_str.js +1 -1
  10. package/cjs/evaluator/matchers/dependency.js +1 -1
  11. package/cjs/evaluator/matchers/eq_set.js +1 -1
  12. package/cjs/evaluator/matchers/ew.js +1 -1
  13. package/cjs/evaluator/matchers/part_of.js +1 -1
  14. package/cjs/evaluator/matchers/segment.js +1 -1
  15. package/cjs/evaluator/matchers/sw.js +1 -1
  16. package/cjs/evaluator/matchers/whitelist.js +1 -1
  17. package/cjs/evaluator/matchersTransform/index.js +12 -12
  18. package/cjs/evaluator/parser/index.js +6 -6
  19. package/cjs/evaluator/treatments/index.js +1 -1
  20. package/cjs/evaluator/value/index.js +1 -1
  21. package/cjs/evaluator/value/sanitize.js +4 -4
  22. package/cjs/integrations/browser.js +3 -3
  23. package/cjs/integrations/ga/GaToSplit.js +14 -14
  24. package/cjs/integrations/ga/GoogleAnalyticsToSplit.js +1 -1
  25. package/cjs/integrations/ga/SplitToGa.js +1 -1
  26. package/cjs/listeners/browser.js +1 -1
  27. package/cjs/listeners/node.js +1 -1
  28. package/cjs/logger/constants.js +3 -1
  29. package/cjs/logger/index.js +2 -2
  30. package/cjs/logger/messages/debug.js +1 -1
  31. package/cjs/logger/messages/error.js +1 -1
  32. package/cjs/logger/messages/info.js +1 -1
  33. package/cjs/logger/messages/warn.js +1 -1
  34. package/cjs/logger/sdkLogger.js +1 -1
  35. package/cjs/readiness/readinessManager.js +2 -2
  36. package/cjs/readiness/sdkReadinessManager.js +4 -4
  37. package/cjs/sdkClient/client.js +9 -9
  38. package/cjs/sdkClient/clientAttributesDecoration.js +4 -4
  39. package/cjs/sdkClient/clientCS.js +2 -2
  40. package/cjs/sdkClient/clientInputValidation.js +14 -14
  41. package/cjs/sdkClient/sdkClient.js +3 -3
  42. package/cjs/sdkClient/sdkClientMethod.js +1 -1
  43. package/cjs/sdkClient/sdkClientMethodCS.js +6 -6
  44. package/cjs/sdkClient/sdkClientMethodCSWithTT.js +8 -8
  45. package/cjs/sdkFactory/index.js +8 -8
  46. package/cjs/sdkManager/index.js +11 -11
  47. package/cjs/services/splitApi.js +3 -2
  48. package/cjs/services/splitHttpClient.js +2 -2
  49. package/cjs/storages/KeyBuilder.js +2 -2
  50. package/cjs/storages/KeyBuilderCS.js +2 -2
  51. package/cjs/storages/KeyBuilderSS.js +1 -1
  52. package/cjs/storages/findLatencyIndex.js +1 -1
  53. package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +1 -1
  54. package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +12 -12
  55. package/cjs/storages/inLocalStorage/index.js +3 -3
  56. package/cjs/storages/inMemory/AttributesCacheInMemory.js +1 -1
  57. package/cjs/storages/inMemory/ImpressionCountsCacheInMemory.js +1 -1
  58. package/cjs/storages/inMemory/LatenciesCacheInMemory.js +1 -1
  59. package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +1 -1
  60. package/cjs/storages/inMemory/SegmentsCacheInMemory.js +2 -2
  61. package/cjs/storages/inMemory/SplitsCacheInMemory.js +5 -5
  62. package/cjs/storages/inRedis/LatenciesCacheInRedis.js +1 -1
  63. package/cjs/storages/inRedis/RedisAdapter.js +16 -10
  64. package/cjs/storages/inRedis/SegmentsCacheInRedis.js +1 -1
  65. package/cjs/storages/inRedis/SplitsCacheInRedis.js +3 -3
  66. package/cjs/storages/inRedis/index.js +1 -1
  67. package/cjs/storages/pluggable/SegmentsCachePluggable.js +1 -1
  68. package/cjs/storages/pluggable/SplitsCachePluggable.js +3 -3
  69. package/cjs/storages/pluggable/inMemoryWrapper.js +4 -4
  70. package/cjs/storages/pluggable/index.js +4 -4
  71. package/cjs/sync/offline/LocalhostFromFile.js +1 -1
  72. package/cjs/sync/offline/LocalhostFromObject.js +1 -1
  73. package/cjs/sync/offline/splitsParser/parseCondition.js +1 -1
  74. package/cjs/sync/offline/splitsParser/splitsParserFromFile.js +13 -13
  75. package/cjs/sync/offline/splitsParser/splitsParserFromSettings.js +3 -3
  76. package/cjs/sync/offline/syncManagerOffline.js +1 -1
  77. package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +2 -2
  78. package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
  79. package/cjs/sync/polling/pollingManagerCS.js +6 -6
  80. package/cjs/sync/polling/pollingManagerSS.js +3 -3
  81. package/cjs/sync/polling/syncTasks/mySegmentsSyncTask.js +1 -1
  82. package/cjs/sync/polling/syncTasks/segmentsSyncTask.js +1 -1
  83. package/cjs/sync/polling/syncTasks/splitsSyncTask.js +1 -1
  84. package/cjs/sync/polling/updaters/mySegmentsUpdater.js +1 -1
  85. package/cjs/sync/polling/updaters/segmentChangesUpdater.js +2 -2
  86. package/cjs/sync/polling/updaters/splitChangesUpdater.js +2 -2
  87. package/cjs/sync/streaming/AuthClient/index.js +3 -3
  88. package/cjs/sync/streaming/SSEHandler/NotificationParser.js +1 -1
  89. package/cjs/sync/streaming/SSEHandler/index.js +3 -3
  90. package/cjs/sync/streaming/mySegmentsV2utils.js +1 -1
  91. package/cjs/sync/streaming/pushManager.js +15 -15
  92. package/cjs/sync/submitters/eventsSyncTask.js +1 -1
  93. package/cjs/sync/submitters/impressionCountsSyncTask.js +1 -1
  94. package/cjs/sync/submitters/impressionsSyncTask.js +3 -3
  95. package/cjs/sync/submitters/metricsSyncTask.js +3 -3
  96. package/cjs/sync/submitters/submitterManager.js +4 -4
  97. package/cjs/sync/submitters/submitterSyncTask.js +1 -1
  98. package/cjs/sync/syncManagerOnline.js +1 -1
  99. package/cjs/trackers/eventTracker.js +3 -3
  100. package/cjs/trackers/impressionObserver/impressionObserverCS.js +1 -1
  101. package/cjs/trackers/impressionObserver/impressionObserverSS.js +1 -1
  102. package/cjs/trackers/impressionsTracker.js +3 -3
  103. package/cjs/utils/MinEvents.js +2 -1
  104. package/cjs/utils/inputValidation/apiKey.js +1 -1
  105. package/cjs/utils/inputValidation/attribute.js +4 -4
  106. package/cjs/utils/inputValidation/attributes.js +2 -2
  107. package/cjs/utils/inputValidation/event.js +1 -1
  108. package/cjs/utils/inputValidation/eventProperties.js +5 -5
  109. package/cjs/utils/inputValidation/eventValue.js +1 -1
  110. package/cjs/utils/inputValidation/key.js +6 -5
  111. package/cjs/utils/inputValidation/preloadedData.js +8 -8
  112. package/cjs/utils/inputValidation/split.js +1 -1
  113. package/cjs/utils/inputValidation/splits.js +2 -2
  114. package/cjs/utils/inputValidation/trafficType.js +1 -1
  115. package/cjs/utils/inputValidation/trafficTypeExistance.js +1 -1
  116. package/cjs/utils/jwt/index.js +1 -1
  117. package/cjs/utils/key/index.js +3 -3
  118. package/cjs/utils/lang/index.js +1 -1
  119. package/cjs/utils/murmur3/common.js +1 -1
  120. package/cjs/utils/murmur3/murmur3.js +10 -10
  121. package/cjs/utils/murmur3/murmur3_128.js +1 -1
  122. package/cjs/utils/murmur3/murmur3_128_x86.js +37 -37
  123. package/cjs/utils/murmur3/murmur3_64.js +1 -1
  124. package/cjs/utils/settingsValidation/index.js +5 -10
  125. package/cjs/utils/settingsValidation/integrations/configurable.js +1 -1
  126. package/cjs/utils/settingsValidation/integrations/pluggable.js +1 -1
  127. package/cjs/utils/settingsValidation/localhost/builtin.js +2 -2
  128. package/cjs/utils/settingsValidation/logger/builtinLogger.js +3 -3
  129. package/cjs/utils/settingsValidation/logger/commons.js +1 -1
  130. package/cjs/utils/settingsValidation/logger/pluggableLogger.js +1 -1
  131. package/cjs/utils/settingsValidation/runtime/browser.js +10 -0
  132. package/cjs/utils/settingsValidation/runtime/node.js +22 -0
  133. package/cjs/utils/settingsValidation/splitFilters.js +1 -1
  134. package/cjs/utils/settingsValidation/storage/storageCS.js +1 -1
  135. package/cjs/utils/timeTracker/index.js +3 -3
  136. package/esm/services/splitApi.js +2 -1
  137. package/esm/storages/inRedis/RedisAdapter.js +7 -1
  138. package/esm/sync/offline/splitsParser/splitsParserFromFile.js +1 -1
  139. package/esm/sync/polling/fetchers/segmentChangesFetcher.js +2 -2
  140. package/esm/utils/inputValidation/key.js +2 -1
  141. package/esm/utils/lang/index.js +2 -2
  142. package/esm/utils/settingsValidation/index.js +1 -6
  143. package/esm/utils/settingsValidation/runtime/browser.js +6 -0
  144. package/esm/utils/settingsValidation/runtime/node.js +17 -0
  145. package/package.json +9 -8
  146. package/src/logger/types.ts +4 -0
  147. package/src/sync/offline/splitsParser/splitsParserFromFile.ts +1 -1
  148. package/src/utils/settingsValidation/index.ts +1 -6
  149. package/src/utils/settingsValidation/runtime/browser.ts +6 -0
  150. package/src/utils/settingsValidation/runtime/node.ts +22 -0
  151. package/src/utils/settingsValidation/types.ts +6 -6
  152. package/types/logger/types.d.ts +4 -0
  153. package/types/sdkClient/clientAttributesDecoration.d.ts +1 -1
  154. package/types/utils/settingsValidation/runtime/browser.d.ts +4 -0
  155. package/types/utils/settingsValidation/runtime/node.d.ts +5 -0
  156. package/types/utils/settingsValidation/types.d.ts +6 -6
@@ -1,4 +1,4 @@
1
- import { __spreadArrays } from "tslib";
1
+ import { __spreadArray } from "tslib";
2
2
  function greedyFetch(fetchSegmentChanges, since, segmentName, noCache) {
3
3
  return fetchSegmentChanges(since, segmentName, noCache)
4
4
  .then(function (resp) { return resp.json(); })
@@ -9,7 +9,7 @@ function greedyFetch(fetchSegmentChanges, since, segmentName, noCache) {
9
9
  }
10
10
  else {
11
11
  return Promise.all([json, greedyFetch(fetchSegmentChanges, till, segmentName, noCache)]).then(function (flatMe) {
12
- return __spreadArrays([flatMe[0]], flatMe[1]);
12
+ return __spreadArray([flatMe[0]], flatMe[1], true);
13
13
  });
14
14
  }
15
15
  });
@@ -35,7 +35,8 @@ export function validateKey(log, maybeKey, method) {
35
35
  var bucketingKey = validateKeyValue(log, maybeKey.bucketingKey, method, 'bucketingKey');
36
36
  if (matchingKey && bucketingKey)
37
37
  return {
38
- matchingKey: matchingKey, bucketingKey: bucketingKey
38
+ matchingKey: matchingKey,
39
+ bucketingKey: bucketingKey
39
40
  };
40
41
  log.error(ERROR_INVALID_KEY_OBJECT, [method]);
41
42
  return false;
@@ -1,4 +1,4 @@
1
- import { __spreadArrays } from "tslib";
1
+ import { __spreadArray } from "tslib";
2
2
  /**
3
3
  * Checks if the target string ends with the sub string.
4
4
  */
@@ -179,7 +179,7 @@ export function merge(target, source) {
179
179
  });
180
180
  if (rest && rest.length) {
181
181
  var nextSource = rest.splice(0, 1)[0];
182
- res = merge.apply(void 0, __spreadArrays([res, nextSource], rest));
182
+ res = merge.apply(void 0, __spreadArray([res, nextSource], rest, false));
183
183
  }
184
184
  return res;
185
185
  }
@@ -64,10 +64,6 @@ var base = {
64
64
  impressionsMode: OPTIMIZED,
65
65
  localhostMode: undefined
66
66
  },
67
- runtime: {
68
- ip: false,
69
- hostname: false
70
- },
71
67
  // Logger
72
68
  log: undefined
73
69
  };
@@ -114,8 +110,7 @@ export function settingsValidation(config, validationParams) {
114
110
  }
115
111
  // Current ip/hostname information
116
112
  // @ts-ignore, modify readonly prop
117
- if (runtime)
118
- withDefaults.runtime = runtime(withDefaults);
113
+ withDefaults.runtime = runtime(withDefaults);
119
114
  // ensure a valid list of integrations.
120
115
  // `integrations` returns an array of valid integration items.
121
116
  // @ts-ignore, modify readonly prop
@@ -0,0 +1,6 @@
1
+ export function validateRuntime() {
2
+ return {
3
+ ip: false,
4
+ hostname: false
5
+ };
6
+ }
@@ -0,0 +1,17 @@
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio-commons",
3
- "version": "1.2.1-rc.1",
3
+ "version": "1.2.1-rc.2",
4
4
  "description": "Split Javascript SDK common components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -20,12 +20,12 @@
20
20
  "check:lint": "eslint src --ext .js,.ts",
21
21
  "check:types": "tsc --noEmit",
22
22
  "build": "npm run build:cjs && npm run build:esm",
23
- "build:esm": "rimraf esm && tsc -m es2015 --outDir esm -d true --declarationDir types --importHelpers",
24
- "build:cjs": "rimraf cjs && tsc -m CommonJS --outDir cjs --importHelpers",
23
+ "build:esm": "rimraf esm && tsc -m es2015 --outDir esm -d true --declarationDir types",
24
+ "build:cjs": "rimraf cjs && tsc -m CommonJS --outDir cjs",
25
25
  "test": "jest",
26
26
  "test:coverage": "jest --coverage",
27
- "publish:rc": "npm run check && npm run build && npm run test && npm publish --tag rc",
28
- "publish:stable": "npm run check && npm run build && npm run test && npm publish"
27
+ "publish:rc": "npm run check && npm run test && npm run build && npm publish --tag rc",
28
+ "publish:stable": "npm run check && npm run test && npm run build && npm publish"
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",
@@ -44,11 +44,12 @@
44
44
  "bugs": "https://github.com/splitio/javascript-commons/issues",
45
45
  "homepage": "https://github.com/splitio/javascript-commons#readme",
46
46
  "dependencies": {
47
- "tslib": "^2.1.0"
47
+ "tslib": "^2.3.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/google.analytics": "0.0.40",
51
51
  "@types/ioredis": "^4.28.0",
52
+ "@types/ip": "^1.1.0",
52
53
  "@types/jest": "^27.0.0",
53
54
  "@types/lodash": "^4.14.162",
54
55
  "@typescript-eslint/eslint-plugin": "^4.2.0",
@@ -58,7 +59,7 @@
58
59
  "eslint": "^7.32.0",
59
60
  "eslint-plugin-compat": "3.7.0",
60
61
  "eslint-plugin-import": "^2.25.3",
61
- "fetch-mock": "^9.10.7",
62
+ "fetch-mock": "^9.11.0",
62
63
  "ioredis": "^4.28.0",
63
64
  "jest": "^27.2.3",
64
65
  "jest-localstorage-mock": "^2.4.3",
@@ -68,7 +69,7 @@
68
69
  "redis-server": "1.2.2",
69
70
  "rimraf": "^3.0.2",
70
71
  "ts-jest": "^27.0.5",
71
- "typescript": "^4.0.2"
72
+ "typescript": "4.4.4"
72
73
  },
73
74
  "sideEffects": false
74
75
  }
@@ -9,11 +9,15 @@ export interface ILoggerOptions {
9
9
  export interface ILogger {
10
10
  setLogLevel(logLevel: LogLevel): void
11
11
 
12
+ debug(msg: unknown): void
12
13
  debug(msg: string | number, args?: any[]): void
13
14
 
15
+ info(msg: unknown): void
14
16
  info(msg: string | number, args?: any[]): void
15
17
 
18
+ warn(msg: unknown): void
16
19
  warn(msg: string | number, args?: any[]): void
17
20
 
21
+ error(msg: unknown): void
18
22
  error(msg: string | number, args?: any[]): void
19
23
  }
@@ -82,7 +82,7 @@ export function splitsParserFromFileFactory(): ISplitsParser {
82
82
  try {
83
83
  data = fs.readFileSync(filePath, 'utf-8');
84
84
  } catch (e) {
85
- log.error(e.message);
85
+ log.error(e && (e as Error).message);
86
86
 
87
87
  return {};
88
88
  }
@@ -78,11 +78,6 @@ const base = {
78
78
  localhostMode: undefined
79
79
  },
80
80
 
81
- runtime: {
82
- ip: false,
83
- hostname: false
84
- },
85
-
86
81
  // Logger
87
82
  log: undefined
88
83
  };
@@ -139,7 +134,7 @@ export function settingsValidation(config: unknown, validationParams: ISettingsV
139
134
 
140
135
  // Current ip/hostname information
141
136
  // @ts-ignore, modify readonly prop
142
- if (runtime) withDefaults.runtime = runtime(withDefaults);
137
+ withDefaults.runtime = runtime(withDefaults);
143
138
 
144
139
  // ensure a valid list of integrations.
145
140
  // `integrations` returns an array of valid integration items.
@@ -0,0 +1,6 @@
1
+ export function validateRuntime() {
2
+ return {
3
+ ip: false,
4
+ hostname: false
5
+ };
6
+ }
@@ -0,0 +1,22 @@
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) {
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
+ }
@@ -6,15 +6,15 @@ import { ISettings } from '../../types';
6
6
  */
7
7
  export interface ISettingsValidationParams {
8
8
  /**
9
- * Object of values to overwrite default settings.
10
- * Version and startup properties are mandatory, because these values are not part of the base setting.
9
+ * Object of values to overwrite base settings.
10
+ * Version and startup properties are required, because they are not defined in the base settings.
11
11
  */
12
12
  defaults: Partial<ISettings> & { version: string } & { startup: ISettings['startup'] },
13
- /** Function to overwrite runtime values (ip and hostname) which are false by default */
14
- runtime?: (settings: ISettings) => ISettings['runtime'],
15
- /** Storage validator */
13
+ /** Function to define runtime values (`settings.runtime`) */
14
+ runtime: (settings: ISettings) => ISettings['runtime'],
15
+ /** Storage validator (`settings.storage`) */
16
16
  storage?: (settings: ISettings) => ISettings['storage'],
17
- /** Integrations validator */
17
+ /** Integrations validator (`settings.integrations`) */
18
18
  integrations?: (settings: ISettings) => ISettings['integrations'],
19
19
  /** Logger validator (`settings.debug`) */
20
20
  logger: (settings: ISettings) => ISettings['log'],
@@ -6,8 +6,12 @@ export interface ILoggerOptions {
6
6
  }
7
7
  export interface ILogger {
8
8
  setLogLevel(logLevel: LogLevel): void;
9
+ debug(msg: unknown): void;
9
10
  debug(msg: string | number, args?: any[]): void;
11
+ info(msg: unknown): void;
10
12
  info(msg: string | number, args?: any[]): void;
13
+ warn(msg: unknown): void;
11
14
  warn(msg: string | number, args?: any[]): void;
15
+ error(msg: unknown): void;
12
16
  error(msg: string | number, args?: any[]): void;
13
17
  }
@@ -8,7 +8,7 @@ export declare function clientAttributesDecoration<TClient extends SplitIO.IClie
8
8
  getTreatmentWithConfig: (maybeKey: SplitIO.SplitKey, maybeSplit: string, maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentWithConfig | SplitIO.AsyncTreatmentWithConfig;
9
9
  getTreatments: (maybeKey: SplitIO.SplitKey, maybeSplits: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.Treatments | SplitIO.AsyncTreatments;
10
10
  getTreatmentsWithConfig: (maybeKey: SplitIO.SplitKey, maybeSplits: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentsWithConfig | SplitIO.AsyncTreatmentsWithConfig;
11
- track: (maybeKey: SplitIO.SplitKey, maybeTT: string, maybeEvent: string, maybeEventValue?: number | undefined, maybeProperties?: SplitIO.Properties | undefined) => import("../dtos/types").MaybeThenable<boolean>;
11
+ track: (maybeKey: SplitIO.SplitKey, maybeTT: string, maybeEvent: string, maybeEventValue?: number | undefined, maybeProperties?: SplitIO.Properties | undefined) => boolean | Promise<boolean>;
12
12
  /**
13
13
  * Add an attribute to client's in memory attributes storage
14
14
  *
@@ -0,0 +1,4 @@
1
+ export declare function validateRuntime(): {
2
+ ip: boolean;
3
+ hostname: boolean;
4
+ };
@@ -0,0 +1,5 @@
1
+ import { ISettings } from '../../../types';
2
+ export declare function validateRuntime(settings: ISettings): {
3
+ ip: string | false;
4
+ hostname: string | false;
5
+ };
@@ -5,19 +5,19 @@ import { ISettings } from '../../types';
5
5
  */
6
6
  export interface ISettingsValidationParams {
7
7
  /**
8
- * Object of values to overwrite default settings.
9
- * Version and startup properties are mandatory, because these values are not part of the base setting.
8
+ * Object of values to overwrite base settings.
9
+ * Version and startup properties are required, because they are not defined in the base settings.
10
10
  */
11
11
  defaults: Partial<ISettings> & {
12
12
  version: string;
13
13
  } & {
14
14
  startup: ISettings['startup'];
15
15
  };
16
- /** Function to overwrite runtime values (ip and hostname) which are false by default */
17
- runtime?: (settings: ISettings) => ISettings['runtime'];
18
- /** Storage validator */
16
+ /** Function to define runtime values (`settings.runtime`) */
17
+ runtime: (settings: ISettings) => ISettings['runtime'];
18
+ /** Storage validator (`settings.storage`) */
19
19
  storage?: (settings: ISettings) => ISettings['storage'];
20
- /** Integrations validator */
20
+ /** Integrations validator (`settings.integrations`) */
21
21
  integrations?: (settings: ISettings) => ISettings['integrations'];
22
22
  /** Logger validator (`settings.debug`) */
23
23
  logger: (settings: ISettings) => ISettings['log'];