Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kameleoon/javascript-sdk-core

Package Overview
Dependencies
Maintainers
3
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kameleoon/javascript-sdk-core - npm Package Compare versions

Comparing version 2.8.3 to 2.9.0

1

dist/kameleoonUtils.d.ts

@@ -12,2 +12,3 @@ import { Result } from 'ts-res';

protected getResultCookie({ domain, visitorCode, }: GetResultCookieParametersType): string;
protected getClientConfigurationUrl(siteCode: string): string;
}

4

dist/kameleoonUtils.js

@@ -1,5 +0,5 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonUtils=void 0;var _tsRes=require("ts-res"),_constants=require("./constants");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _iterableToArrayLimit(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=c){var d,e,f,g,h=[],i=!0,j=!1;try{if(f=(c=c.call(a)).next,0===b){if(Object(c)!==c)return;i=!1}else for(;!(i=(d=f.call(c)).done)&&(h.push(d.value),h.length!==b);i=!0);}catch(a){j=!0,e=a}finally{try{if(!i&&null!=c.return&&(g=c.return(),Object(g)!==g))return}finally{if(j)throw e}}return h}}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}/**
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonUtils=void 0;var _tsRes=require("ts-res"),_requester=require("./requester"),_constants=require("./constants");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _iterableToArrayLimit(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=c){var d,e,f,g,h=[],i=!0,j=!1;try{if(f=(c=c.call(a)).next,0===b){if(Object(c)!==c)return;i=!1}else for(;!(i=(d=f.call(c)).done)&&(h.push(d.value),h.length!==b);i=!0);}catch(a){j=!0,e=a}finally{try{if(!i&&null!=c.return&&(g=c.return(),Object(g)!==g))return}finally{if(j)throw e}}return h}}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}/**
* @abstract
* KameleoonUtils - an abstract class for extending kameleoon utils with pre-defined method signatures
* */var KameleoonUtils=/*#__PURE__*/function(){function a(){_classCallCheck(this,a)}return _createClass(a,[{key:"generateRandomString",value:function generateRandomString(a){var b="";if(0>a)return b;for(var c=0;c<a;c++)b+="abcdefghijklmnopqrstuvwxyz0123456789"[Math.floor(36*Math.random())];return b}},{key:"getCookieVisitorCode",value:function getCookieVisitorCode(a){var b=a.split(_constants.Cookie.PairsDelimiter),c=b.find(function(a){var b=a.split(_constants.Cookie.KeyValueDelimiter),c=_slicedToArray(b,2),d=c[0],e=c[1];return d===_constants.KAMELEOON_COOKIE_KEY});if(c){var d=c.split(_constants.Cookie.KeyValueDelimiter),e=_slicedToArray(d,2),f=e[0],g=e[1];return(0,_tsRes.Ok)(g)}return(0,_tsRes.Err)()}},{key:"getResultCookie",value:function getResultCookie(a){var b=a.domain,c=a.visitorCode,d=[_constants.KAMELEOON_COOKIE_KEY+_constants.Cookie.KeyValueDelimiter+c,_constants.Cookie.MaxAge+_constants.Cookie.KeyValueDelimiter+31536000,_constants.Cookie.Path+_constants.Cookie.KeyValueDelimiter+"/",_constants.Cookie.Domain+_constants.Cookie.KeyValueDelimiter+b];return d.join(_constants.Cookie.PairsDelimiter)}}]),a}();exports.KameleoonUtils=KameleoonUtils;
* */var KameleoonUtils=/*#__PURE__*/function(){function a(){_classCallCheck(this,a)}return _createClass(a,[{key:"generateRandomString",value:function generateRandomString(a){var b="";if(0>a)return b;for(var c=0;c<a;c++)b+="abcdefghijklmnopqrstuvwxyz0123456789"[Math.floor(36*Math.random())];return b}},{key:"getCookieVisitorCode",value:function getCookieVisitorCode(a){var b=a.split(_constants.Cookie.PairsDelimiter),c=b.find(function(a){var b=a.split(_constants.Cookie.KeyValueDelimiter),c=_slicedToArray(b,2),d=c[0],e=c[1];return d===_constants.KAMELEOON_COOKIE_KEY});if(c){var d=c.split(_constants.Cookie.KeyValueDelimiter),e=_slicedToArray(d,2),f=e[0],g=e[1];return(0,_tsRes.Ok)(g)}return(0,_tsRes.Err)()}},{key:"getResultCookie",value:function getResultCookie(a){var b=a.domain,c=a.visitorCode,d=[_constants.KAMELEOON_COOKIE_KEY+_constants.Cookie.KeyValueDelimiter+c,_constants.Cookie.MaxAge+_constants.Cookie.KeyValueDelimiter+31536000,_constants.Cookie.Path+_constants.Cookie.KeyValueDelimiter+"/",_constants.Cookie.Domain+_constants.Cookie.KeyValueDelimiter+b];return d.join(_constants.Cookie.PairsDelimiter)}},{key:"getClientConfigurationUrl",value:function getClientConfigurationUrl(a){return _requester.URL.CLIENT_CONFIGURATION+_requester.UrlQuery.Mobile+a}}]),a}();exports.KameleoonUtils=KameleoonUtils;
//# sourceMappingURL=kameleoonUtils.js.map

@@ -1,2 +0,3 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UrlTracking=exports.UrlQuery=exports.UrlParameter=exports.UrlEventType=exports.URL=exports.Header=void 0;var Header=/*#__PURE__*/function(a){return a.UserAgent="User-Agent",a.ContentType="Content-Type",a.Authorization="Authorization",a}({});exports.Header=Header;var topLevelDomain="com",dataTopLevelDomain="io",UrlEventType={CustomData:"eventType=customData",StaticData:"eventType=staticData",Page:"eventType=page",Conversion:"eventType=conversion",Activity:"eventType=activity",Experiment:"eventType=experiment"};exports.UrlEventType=UrlEventType;var UrlParameter={Title:"&title=",ReferrersIndices:"&referrersIndices=",Negative:"&negative=",Revenue:"&revenue=",Overwrite:"&overwrite=",Index:"&index=",BrowserIndex:"&browserIndex=",BrowserVersion:"&browserVersion=",Href:"&href=",DeviceType:"&deviceType=",SiteCode:"&siteCode=",GoalId:"&goalId=",VisitorCode:"&visitorCode=",Environment:"&environment=",VariationId:"&variationId=",Ts:"&ts=",Key:"&key=",SdkName:"&sdkName=",SdkVersion:"&sdkVersion=",ValuesCountMap:"&valuesCountMap=",Nonce:"&nonce=",Id:"&id=",CustomData:"&customData=",CurrentVisit:"&currentVisit=",MaxNumberPreviousVisits:"&maxNumberPreviousVisits="};exports.UrlParameter=UrlParameter;var UrlQuery={Sse:"sse?siteCode=",Mobile:"mobile?siteCode=",Map:"map?siteCode=",Events:"events?siteCode=",Visitor:"visitor?siteCode="};exports.UrlQuery=UrlQuery;var UrlTracking={Visit:"visit/",Map:"map/"};exports.UrlTracking=UrlTracking;var URL_DATA_API="https://data.kameleoon.".concat(dataTopLevelDomain),URL={SERVER_SENT_EVENTS:"https://events.kameleoon.".concat("com",":8110/"),CLIENT_CONFIGURATION:"https://client-config.kameleoon.".concat("com","/"),VISIT_EVENT:"".concat(URL_DATA_API,"/").concat(UrlTracking.Visit+UrlQuery.Events),VISIT_DATA:"".concat(URL_DATA_API,"/").concat(UrlTracking.Visit+UrlQuery.Visitor),DATA_MAP:"".concat(URL_DATA_API,"/").concat(UrlTracking.Map+UrlQuery.Map)};exports.URL=URL;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UrlTracking=exports.UrlQuery=exports.UrlParameter=exports.UrlEventType=exports.URL=exports.Header=void 0;var Header=/*#__PURE__*/function(a){return a.UserAgent="User-Agent",a.ContentType="Content-Type",a.Authorization="Authorization",a}({});// TODO: Change .COM to .NET when preview is fixed
exports.Header=Header;var topLevelDomain="com",dataTopLevelDomain="io",UrlEventType={CustomData:"eventType=customData",StaticData:"eventType=staticData",Page:"eventType=page",Conversion:"eventType=conversion",Activity:"eventType=activity",Experiment:"eventType=experiment"};exports.UrlEventType=UrlEventType;var UrlParameter={Title:"&title=",ReferrersIndices:"&referrersIndices=",Negative:"&negative=",Revenue:"&revenue=",Overwrite:"&overwrite=",Index:"&index=",BrowserIndex:"&browserIndex=",BrowserVersion:"&browserVersion=",Href:"&href=",DeviceType:"&deviceType=",SiteCode:"&siteCode=",GoalId:"&goalId=",VisitorCode:"&visitorCode=",Environment:"&environment=",VariationId:"&variationId=",Ts:"&ts=",Key:"&key=",SdkName:"&sdkName=",SdkVersion:"&sdkVersion=",ValuesCountMap:"&valuesCountMap=",Nonce:"&nonce=",Id:"&id=",CustomData:"&customData=",CurrentVisit:"&currentVisit=",MaxNumberPreviousVisits:"&maxNumberPreviousVisits="};exports.UrlParameter=UrlParameter;var UrlQuery={Sse:"sse?siteCode=",Mobile:"mobile?siteCode=",Map:"map?siteCode=",Events:"events?siteCode=",Visitor:"visitor?siteCode="};exports.UrlQuery=UrlQuery;var UrlTracking={Visit:"visit/",Map:"map/"};exports.UrlTracking=UrlTracking;var URL_DATA_API="https://data.kameleoon.".concat(dataTopLevelDomain),URL={SERVER_SENT_EVENTS:"https://events.kameleoon.".concat("com",":8110/"),CLIENT_CONFIGURATION:"https://client-config.kameleoon.".concat("com","/"),VISIT_EVENT:"".concat(URL_DATA_API,"/").concat(UrlTracking.Visit+UrlQuery.Events),VISIT_DATA:"".concat(URL_DATA_API,"/").concat(UrlTracking.Visit+UrlQuery.Visitor),DATA_MAP:"".concat(URL_DATA_API,"/").concat(UrlTracking.Map+UrlQuery.Map)};exports.URL=URL;
//# sourceMappingURL=constants.js.map
{
"name": "@kameleoon/javascript-sdk-core",
"version": "2.8.3",
"version": "2.9.0",
"description": "Kameleoon JS SDK Core",

@@ -53,2 +53,2 @@ "main": "dist/index.js",

}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc