@splitsoftware/splitio-browserjs 0.8.0 → 0.8.1-rc.0

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.
@@ -19,7 +19,7 @@ var platform = { getFetch: getFetchFull_1.getFetch, getEventSource: getEventSour
19
19
  * @throws Will throw an error if the provided config is invalid.
20
20
  */
21
21
  function SplitFactory(config, __updateModules) {
22
- var settings = (0, full_1.settingsValidator)(config);
22
+ var settings = (0, full_1.settingsFactory)(config);
23
23
  var modules = (0, getModules_1.getModules)(settings, platform);
24
24
  if (__updateModules)
25
25
  __updateModules(modules);
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaults = void 0;
4
4
  var index_1 = require("@splitsoftware/splitio-commons/cjs/logger/index");
5
5
  var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
6
- var packageVersion = '0.8.0';
6
+ var packageVersion = '0.8.1-rc.0';
7
7
  /**
8
8
  * In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
9
9
  * Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.settingsValidator = void 0;
3
+ exports.settingsFactory = void 0;
4
4
  var index_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/index");
5
5
  var defaults_1 = require("./defaults");
6
6
  var runtime_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/runtime");
@@ -19,7 +19,7 @@ var params = {
19
19
  localhost: builtin_1.validateLocalhostWithDefault,
20
20
  consent: consent_1.validateConsent,
21
21
  };
22
- function settingsValidator(config) {
22
+ function settingsFactory(config) {
23
23
  return (0, index_1.settingsValidation)(config, params);
24
24
  }
25
- exports.settingsValidator = settingsValidator;
25
+ exports.settingsFactory = settingsFactory;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.settingsValidator = void 0;
3
+ exports.settingsFactory = void 0;
4
4
  var index_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/index");
5
5
  var defaults_1 = require("./defaults");
6
6
  var runtime_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/runtime");
@@ -19,7 +19,7 @@ var params = {
19
19
  localhost: pluggable_2.validateLocalhost,
20
20
  consent: consent_1.validateConsent,
21
21
  };
22
- function settingsValidator(config) {
22
+ function settingsFactory(config) {
23
23
  return (0, index_1.settingsValidation)(config, params);
24
24
  }
25
- exports.settingsValidator = settingsValidator;
25
+ exports.settingsFactory = settingsFactory;
@@ -19,7 +19,7 @@ var platform = { getFetch: getFetchSlim_1.getFetch, getEventSource: getEventSour
19
19
  * @throws Will throw an error if the provided config is invalid.
20
20
  */
21
21
  function SplitFactory(config, __updateModules) {
22
- var settings = (0, settings_1.settingsValidator)(config);
22
+ var settings = (0, settings_1.settingsFactory)(config);
23
23
  var modules = (0, getModules_1.getModules)(settings, platform);
24
24
  if (__updateModules)
25
25
  __updateModules(modules);
@@ -1,4 +1,4 @@
1
- import { settingsValidator } from '../settings/full';
1
+ import { settingsFactory } from '../settings/full';
2
2
  import { getModules } from '../platform/getModules';
3
3
  import { sdkFactory } from '@splitsoftware/splitio-commons/esm/sdkFactory/index';
4
4
  import { getFetch } from '../platform/getFetchFull';
@@ -16,7 +16,7 @@ var platform = { getFetch: getFetch, getEventSource: getEventSource, EventEmitte
16
16
  * @throws Will throw an error if the provided config is invalid.
17
17
  */
18
18
  export function SplitFactory(config, __updateModules) {
19
- var settings = settingsValidator(config);
19
+ var settings = settingsFactory(config);
20
20
  var modules = getModules(settings, platform);
21
21
  if (__updateModules)
22
22
  __updateModules(modules);
@@ -1,6 +1,6 @@
1
1
  import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/esm/logger/index';
2
2
  import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/esm/utils/constants';
3
- var packageVersion = '0.8.0';
3
+ var packageVersion = '0.8.1-rc.0';
4
4
  /**
5
5
  * In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
6
6
  * Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
@@ -16,6 +16,6 @@ var params = {
16
16
  localhost: validateLocalhostWithDefault,
17
17
  consent: validateConsent,
18
18
  };
19
- export function settingsValidator(config) {
19
+ export function settingsFactory(config) {
20
20
  return settingsValidation(config, params);
21
21
  }
@@ -16,6 +16,6 @@ var params = {
16
16
  localhost: validateLocalhost,
17
17
  consent: validateConsent,
18
18
  };
19
- export function settingsValidator(config) {
19
+ export function settingsFactory(config) {
20
20
  return settingsValidation(config, params);
21
21
  }
@@ -1,4 +1,4 @@
1
- import { settingsValidator } from './settings';
1
+ import { settingsFactory } from './settings';
2
2
  import { getModules } from './platform/getModules';
3
3
  import { sdkFactory } from '@splitsoftware/splitio-commons/esm/sdkFactory/index';
4
4
  import { getFetch } from './platform/getFetchSlim';
@@ -16,7 +16,7 @@ var platform = { getFetch: getFetch, getEventSource: getEventSource, EventEmitte
16
16
  * @throws Will throw an error if the provided config is invalid.
17
17
  */
18
18
  export function SplitFactory(config, __updateModules) {
19
- var settings = settingsValidator(config);
19
+ var settings = settingsFactory(config);
20
20
  var modules = getModules(settings, platform);
21
21
  if (__updateModules)
22
22
  __updateModules(modules);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio-browserjs",
3
- "version": "0.8.0",
3
+ "version": "0.8.1-rc.0",
4
4
  "description": "Split SDK for Javascript on Browser",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -30,18 +30,16 @@
30
30
  "build:ga-to-split-autorequire": "terser ./node_modules/@splitsoftware/splitio-commons/src/integrations/ga/autoRequire.js --mangle --output ./scripts/ga-to-split-autorequire.js",
31
31
  "test": "npm run test:unit && npm run test:e2e",
32
32
  "test:unit": "jest",
33
- "test:e2e": "npm run test:e2e-logger && npm run test:e2e-offline && npm run test:e2e-online && npm run test:e2e-destroy && npm run test:e2e-errors && npm run test:e2e-push && npm run test:e2e-gaintegration && npm run test:e2e-consumer",
33
+ "test:e2e": "npm run test:e2e-logger && npm run test:e2e-offline && npm run test:e2e-online && npm run test:e2e-destroy && npm run test:e2e-errorCatching && npm run test:e2e-push && npm run test:e2e-gaIntegration && npm run test:e2e-consumer",
34
34
  "test:e2e-logger": "karma start karma/e2e.logger.karma.conf.js",
35
35
  "test:e2e-offline": "karma start karma/e2e.offline.karma.conf.js",
36
36
  "test:e2e-online": "karma start karma/e2e.online.karma.conf.js",
37
37
  "test:e2e-destroy": "karma start karma/e2e.destroy.karma.conf.js",
38
- "test:e2e-errors": "karma start karma/e2e.errors.karma.conf.js",
38
+ "test:e2e-errorCatching": "karma start karma/e2e.errorCatching.karma.conf.js",
39
39
  "test:e2e-push": "karma start karma/e2e.push.karma.conf.js",
40
- "test:e2e-gaintegration": "karma start karma/e2e.gaintegration.karma.conf.js",
40
+ "test:e2e-gaIntegration": "karma start karma/e2e.gaIntegration.karma.conf.js",
41
41
  "test:e2e-consumer": "karma start karma/e2e.consumer.karma.conf.js",
42
- "pretest-ts-decls": "npm run build:esm && npm run build:cjs && npm link",
43
- "test-ts-decls": "./scripts/ts-tests.sh",
44
- "posttest-ts-decls": "npm unlink && npm install",
42
+ "test-ts-decls": "tsc --build ts-tests",
45
43
  "publish:rc": "npm run check && npm run build && npm publish --tag rc",
46
44
  "publish:stable": "npm run check && npm run build && npm publish"
47
45
  },
@@ -63,7 +61,7 @@
63
61
  "bugs": "https://github.com/splitio/javascript-browser-client/issues",
64
62
  "homepage": "https://github.com/splitio/javascript-browser-client#readme",
65
63
  "dependencies": {
66
- "@splitsoftware/splitio-commons": "1.6.1",
64
+ "@splitsoftware/splitio-commons": "1.6.2-rc.4",
67
65
  "@types/google.analytics": "0.0.40"
68
66
  },
69
67
  "devDependencies": {
@@ -1,4 +1,4 @@
1
- import { settingsValidator } from '../settings/full';
1
+ import { settingsFactory } from '../settings/full';
2
2
  import { getModules } from '../platform/getModules';
3
3
  import { sdkFactory } from '@splitsoftware/splitio-commons/src/sdkFactory/index';
4
4
  import { ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory/types';
@@ -19,7 +19,7 @@ const platform = { getFetch, getEventSource, EventEmitter, now };
19
19
  * @throws Will throw an error if the provided config is invalid.
20
20
  */
21
21
  export function SplitFactory(config: any, __updateModules?: (modules: ISdkFactoryParams) => void) {
22
- const settings = settingsValidator(config);
22
+ const settings = settingsFactory(config);
23
23
  const modules = getModules(settings, platform);
24
24
  if (__updateModules) __updateModules(modules);
25
25
  return sdkFactory(modules);
@@ -10,7 +10,7 @@ import { pluggableIntegrationsManagerFactory } from '@splitsoftware/splitio-comm
10
10
 
11
11
  import { shouldAddPt } from '@splitsoftware/splitio-commons/src/trackers/impressionObserver/utils';
12
12
  import { IPlatform, ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory/types';
13
- import { ISettings } from '@splitsoftware/splitio-commons/src/types';
13
+ import { IntegrationFactory, ISettings } from '@splitsoftware/splitio-commons/src/types';
14
14
  import { CONSUMER_MODE, CONSUMER_PARTIAL_MODE, LOCALHOST_MODE } from '@splitsoftware/splitio-commons/src/utils/constants';
15
15
  import { createUserConsentAPI } from '@splitsoftware/splitio-commons/src/consent/sdkUserConsent';
16
16
 
@@ -26,7 +26,7 @@ export function getModules(settings: ISettings, platform: IPlatform): ISdkFactor
26
26
 
27
27
  platform,
28
28
 
29
- storageFactory: settings.storage,
29
+ storageFactory: settings.storage as ISdkFactoryParams['storageFactory'],
30
30
 
31
31
  splitApiFactory,
32
32
 
@@ -38,7 +38,7 @@ export function getModules(settings: ISettings, platform: IPlatform): ISdkFactor
38
38
 
39
39
  SignalListener: BrowserSignalListener as ISdkFactoryParams['SignalListener'],
40
40
 
41
- integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? pluggableIntegrationsManagerFactory.bind(null, settings.integrations) : undefined,
41
+ integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? pluggableIntegrationsManagerFactory.bind(null, settings.integrations as IntegrationFactory[]) : undefined,
42
42
 
43
43
  impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverCSFactory : undefined,
44
44
 
@@ -2,7 +2,7 @@ import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/src/
2
2
  import { ConsentStatus, LogLevel } from '@splitsoftware/splitio-commons/src/types';
3
3
  import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/src/utils/constants';
4
4
 
5
- const packageVersion = '0.8.0';
5
+ const packageVersion = '0.8.1-rc.0';
6
6
 
7
7
  /**
8
8
  * In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
@@ -18,6 +18,6 @@ const params = {
18
18
  consent: validateConsent,
19
19
  };
20
20
 
21
- export function settingsValidator(config: any) {
21
+ export function settingsFactory(config: any) {
22
22
  return settingsValidation(config, params);
23
23
  }
@@ -18,6 +18,6 @@ const params = {
18
18
  consent: validateConsent,
19
19
  };
20
20
 
21
- export function settingsValidator(config: any) {
21
+ export function settingsFactory(config: any) {
22
22
  return settingsValidation(config, params);
23
23
  }
@@ -1,4 +1,4 @@
1
- import { settingsValidator } from './settings';
1
+ import { settingsFactory } from './settings';
2
2
  import { getModules } from './platform/getModules';
3
3
  import { sdkFactory } from '@splitsoftware/splitio-commons/src/sdkFactory/index';
4
4
  import { ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory/types';
@@ -19,7 +19,7 @@ const platform = { getFetch, getEventSource, EventEmitter, now };
19
19
  * @throws Will throw an error if the provided config is invalid.
20
20
  */
21
21
  export function SplitFactory(config: any, __updateModules?: (modules: ISdkFactoryParams) => void) {
22
- const settings = settingsValidator(config);
22
+ const settings = settingsFactory(config);
23
23
  const modules = getModules(settings, platform);
24
24
  if (__updateModules) __updateModules(modules);
25
25
  return sdkFactory(modules);
@@ -3,9 +3,8 @@
3
3
  // Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
4
4
 
5
5
  /// <reference path="../splitio.d.ts" />
6
- export = JsSdk;
7
6
 
8
- declare module JsSdk {
7
+ declare module '@splitsoftware/splitio-browserjs/full' {
9
8
  /**
10
9
  * Full version of the Split.io sdk factory function.
11
10
  *
@@ -30,7 +29,7 @@ declare module JsSdk {
30
29
  *
31
30
  * @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#sharing-state-with-a-pluggable-storage}
32
31
  */
33
- export function PluggableStorage(options: SplitIO.PluggableStorageOptions): SplitIO.StorageAsyncFactory;
32
+ export function PluggableStorage(options: SplitIO.PluggableStorageOptions): SplitIO.StorageAsyncFactory;
34
33
 
35
34
  /**
36
35
  * Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events.
package/types/index.d.ts CHANGED
@@ -3,9 +3,8 @@
3
3
  // Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
4
4
 
5
5
  /// <reference path="./splitio.d.ts" />
6
- export = JsSdk;
7
6
 
8
- declare module JsSdk {
7
+ declare module '@splitsoftware/splitio-browserjs' {
9
8
  /**
10
9
  * Slim version of the Split.io sdk factory function.
11
10
  *