@splitsoftware/splitio 10.17.4-rc.3 → 10.17.4-rc.4

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/CHANGES.txt CHANGED
@@ -1,4 +1,4 @@
1
- 10.18.0 (March XXX, 2022)
1
+ 10.18.0 (April 4, 2022)
2
2
  - Updated internal dependencies to use @splitsoftware/splitio-commons dependency, which includes:
3
3
  - Added support for user consent in client-side
4
4
  - Added impressionsQueueSize config parameter
@@ -12,7 +12,7 @@ import { __InLocalStorageMockFactory } from '@splitsoftware/splitio-commons/esm/
12
12
  import { sdkFactory } from '@splitsoftware/splitio-commons/esm/sdkFactory';
13
13
  import { LOCALHOST_MODE, STORAGE_LOCALSTORAGE } from '@splitsoftware/splitio-commons/esm/utils/constants';
14
14
  import { shouldAddPt } from '@splitsoftware/splitio-commons/esm/trackers/impressionObserver/utils';
15
- import { userConsentProps } from '@splitsoftware/splitio-commons/esm/sdkFactory/userConsentProps';
15
+ import { createUserConsentAPI } from '@splitsoftware/splitio-commons/esm/consent/sdkUserConsent';
16
16
  import { settingsFactory } from '../settings/browser';
17
17
  import { platform, SignalListener } from '../platform';
18
18
  var syncManagerOnlineCSFactory = syncManagerOnlineFactory(pollingManagerCSFactory, pushManagerFactory);
@@ -39,7 +39,11 @@ function getModules(settings) {
39
39
  SignalListener: SignalListener,
40
40
  integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? integrationsManagerFactory.bind(null, settings.integrations) : undefined,
41
41
  impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverCSFactory : undefined,
42
- extraProps: userConsentProps
42
+ extraProps: function (params) {
43
+ return {
44
+ UserConsent: createUserConsentAPI(params)
45
+ };
46
+ }
43
47
  };
44
48
  switch (settings.mode) {
45
49
  case LOCALHOST_MODE:
@@ -1 +1 @@
1
- export var packageVersion = '10.17.4-rc.3';
1
+ export var packageVersion = '10.17.4-rc.4';
@@ -15,7 +15,7 @@ var storageCS_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsVali
15
15
  var sdkFactory_1 = require("@splitsoftware/splitio-commons/cjs/sdkFactory");
16
16
  var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
17
17
  var utils_1 = require("@splitsoftware/splitio-commons/cjs/trackers/impressionObserver/utils");
18
- var userConsentProps_1 = require("@splitsoftware/splitio-commons/cjs/sdkFactory/userConsentProps");
18
+ var sdkUserConsent_1 = require("@splitsoftware/splitio-commons/cjs/consent/sdkUserConsent");
19
19
  var browser_2 = require("../settings/browser");
20
20
  var platform_1 = require("../platform");
21
21
  var syncManagerOnlineCSFactory = (0, syncManagerOnline_1.syncManagerOnlineFactory)(pollingManagerCS_1.pollingManagerCSFactory, pushManager_1.pushManagerFactory);
@@ -42,7 +42,11 @@ function getModules(settings) {
42
42
  SignalListener: platform_1.SignalListener,
43
43
  integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? browser_1.integrationsManagerFactory.bind(null, settings.integrations) : undefined,
44
44
  impressionsObserverFactory: (0, utils_1.shouldAddPt)(settings) ? impressionObserverCS_1.impressionObserverCSFactory : undefined,
45
- extraProps: userConsentProps_1.userConsentProps
45
+ extraProps: function (params) {
46
+ return {
47
+ UserConsent: (0, sdkUserConsent_1.createUserConsentAPI)(params)
48
+ };
49
+ }
46
50
  };
47
51
  switch (settings.mode) {
48
52
  case constants_1.LOCALHOST_MODE:
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.packageVersion = void 0;
4
- exports.packageVersion = '10.17.4-rc.3';
4
+ exports.packageVersion = '10.17.4-rc.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio",
3
- "version": "10.17.4-rc.3",
3
+ "version": "10.17.4-rc.4",
4
4
  "description": "Split SDK",
5
5
  "files": [
6
6
  "README.md",
@@ -32,7 +32,7 @@
32
32
  "node": ">=6"
33
33
  },
34
34
  "dependencies": {
35
- "@splitsoftware/splitio-commons": "1.2.1-rc.10",
35
+ "@splitsoftware/splitio-commons": "1.2.1-rc.12",
36
36
  "@types/google.analytics": "0.0.40",
37
37
  "@types/ioredis": "^4.28.0",
38
38
  "ioredis": "^4.28.0",
@@ -12,7 +12,7 @@ import { __InLocalStorageMockFactory } from '@splitsoftware/splitio-commons/src/
12
12
  import { sdkFactory } from '@splitsoftware/splitio-commons/src/sdkFactory';
13
13
  import { LOCALHOST_MODE, STORAGE_LOCALSTORAGE } from '@splitsoftware/splitio-commons/src/utils/constants';
14
14
  import { shouldAddPt } from '@splitsoftware/splitio-commons/src/trackers/impressionObserver/utils';
15
- import { userConsentProps } from '@splitsoftware/splitio-commons/src/sdkFactory/userConsentProps';
15
+ import { createUserConsentAPI } from '@splitsoftware/splitio-commons/src/consent/sdkUserConsent';
16
16
 
17
17
  import { settingsFactory } from '../settings/browser';
18
18
  import { platform, SignalListener } from '../platform';
@@ -54,7 +54,11 @@ function getModules(settings) {
54
54
 
55
55
  impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverCSFactory : undefined,
56
56
 
57
- extraProps: userConsentProps
57
+ extraProps: (params) => {
58
+ return {
59
+ UserConsent: createUserConsentAPI(params)
60
+ };
61
+ }
58
62
  };
59
63
 
60
64
  switch (settings.mode) {
@@ -1 +1 @@
1
- export const packageVersion = '10.17.4-rc.3';
1
+ export const packageVersion = '10.17.4-rc.4';
@@ -143,7 +143,38 @@ interface ILoggerAPI {
143
143
  * Log level constants. Use this to pass them to setLogLevel function.
144
144
  */
145
145
  LogLevel: {
146
- [level: string]: LogLevel
146
+ [level in LogLevel]: LogLevel
147
+ }
148
+ }
149
+ /**
150
+ * User consent API
151
+ * @interface IUserConsentAPI
152
+ */
153
+ interface IUserConsentAPI {
154
+ /**
155
+ * Set or update the user consent status. Possible values are `true` and `false`, which represent user consent `'GRANTED'` and `'DECLINED'` respectively.
156
+ * - `true ('GRANTED')`: the user has granted consent for tracking events and impressions. The SDK will send them to Split cloud.
157
+ * - `false ('DECLINED')`: the user has declined consent for tracking events and impressions. The SDK will not send them to Split cloud.
158
+ *
159
+ * NOTE: calling this method updates the user consent at a factory level, affecting all clients of the same factory.
160
+ *
161
+ * @function setStatus
162
+ * @param {boolean} userConsent The user consent status, true for 'GRANTED' and false for 'DECLINED'.
163
+ * @returns {boolean} Whether the provided param is a valid value (i.e., a boolean value) or not.
164
+ */
165
+ setStatus(userConsent: boolean): boolean;
166
+ /**
167
+ * Get the user consent status.
168
+ *
169
+ * @function getStatus
170
+ * @returns {ConsentStatus} The user consent status.
171
+ */
172
+ getStatus(): SplitIO.ConsentStatus;
173
+ /**
174
+ * Consent status constants. Use this to compare with the getStatus function result.
175
+ */
176
+ Status: {
177
+ [status in SplitIO.ConsentStatus]: SplitIO.ConsentStatus
147
178
  }
148
179
  }
149
180
  /**
@@ -1215,24 +1246,10 @@ declare namespace SplitIO {
1215
1246
  */
1216
1247
  client(key: SplitKey, trafficType?: string): IBrowserClient
1217
1248
  /**
1218
- * Set or update the user consent status. Possible values are `true` and `false`, which represent user consent `'GRANTED'` and `'DECLINED'` respectively.
1219
- * - `true ('GRANTED')`: the user has granted consent for tracking events and impressions. The SDK will send them to Split cloud.
1220
- * - `false ('DECLINED')`: the user has declined consent for tracking events and impressions. The SDK will not send them to Split cloud.
1221
- *
1222
- * NOTE: calling this method updates the user consent at a factory level, affecting all clients of the same factory.
1223
- *
1224
- * @function setUserConsent
1225
- * @param {boolean} userConsent The user consent status, true for 'GRANTED' and false for 'DECLINED'.
1226
- * @returns {boolean} Whether the provided param is a valid value (i.e., a boolean value) or not.
1227
- */
1228
- setUserConsent(userConsent: boolean): boolean;
1229
- /**
1230
- * Get the user consent status.
1231
- *
1232
- * @function getUserConsent
1233
- * @returns {ConsentStatus} The user consent status.
1249
+ * User consent API.
1250
+ * @property UserConsent
1234
1251
  */
1235
- getUserConsent(): ConsentStatus;
1252
+ UserConsent: IUserConsentAPI
1236
1253
  }
1237
1254
  /**
1238
1255
  * This represents the interface for the SDK instance with asynchronous storage.