@rudderstack/analytics-js-cookies
Advanced tools
Comparing version 0.4.16 to 0.4.17
@@ -5,2 +5,12 @@ # Changelog | ||
## [0.4.17](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-cookies@0.4.16...@rudderstack/analytics-js-cookies@0.4.17) (2024-12-17) | ||
### Dependency Updates | ||
* `@rudderstack/analytics-js-common` updated to version `3.14.14` | ||
### Bug Fixes | ||
* remove circular dependency in packages ([#1973](https://github.com/rudderlabs/rudder-sdk-js/issues/1973)) ([e525496](https://github.com/rudderlabs/rudder-sdk-js/commit/e5254964310c2c73baaf4d0655c3e4025c5e7d2b)) | ||
## [0.4.16](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-cookies@0.4.15...@rudderstack/analytics-js-cookies@0.4.16) (2024-12-06) | ||
@@ -7,0 +17,0 @@ |
@@ -112,4 +112,2 @@ (function (global, factory) { | ||
var userIdKey='rl_user_id';var userTraitsKey='rl_trait';var anonymousUserIdKey='rl_anonymous_id';var groupIdKey='rl_group_id';var groupTraitsKey='rl_group_trait';var pageInitialReferrerKey='rl_page_init_referrer';var pageInitialReferringDomainKey='rl_page_init_referring_domain';var sessionInfoKey='rl_session';var authTokenKey='rl_auth_token';var COOKIE_KEYS={userId:userIdKey,userTraits:userTraitsKey,anonymousId:anonymousUserIdKey,groupId:groupIdKey,groupTraits:groupTraitsKey,initialReferrer:pageInitialReferrerKey,initialReferringDomain:pageInitialReferringDomainKey,sessionInfo:sessionInfoKey,authToken:authTokenKey};var ENCRYPTION_PREFIX_V3='RS_ENC_v3_'; | ||
/** | ||
@@ -134,2 +132,4 @@ * Encode. | ||
var userIdKey='rl_user_id';var userTraitsKey='rl_trait';var anonymousUserIdKey='rl_anonymous_id';var groupIdKey='rl_group_id';var groupTraitsKey='rl_group_trait';var pageInitialReferrerKey='rl_page_init_referrer';var pageInitialReferringDomainKey='rl_page_init_referring_domain';var sessionInfoKey='rl_session';var authTokenKey='rl_auth_token';var COOKIE_KEYS={userId:userIdKey,userTraits:userTraitsKey,anonymousId:anonymousUserIdKey,groupId:groupIdKey,groupTraits:groupTraitsKey,initialReferrer:pageInitialReferrerKey,initialReferringDomain:pageInitialReferringDomainKey,sessionInfo:sessionInfoKey,authToken:authTokenKey};var ENCRYPTION_PREFIX_V3='RS_ENC_v3_'; | ||
var getEncryptedValueInternal=function getEncryptedValueInternal(value,encryptFn,debug){var fallbackValue=null;try{var strValue=stringifyWithoutCircular(value,false);if(isNull(strValue)){return null;}return encryptFn(strValue);}catch(err){if(debug){console.error('Error occurred during encryption: ',err);}return fallbackValue;}};var getDecryptedValueInternal=function getDecryptedValueInternal(value,decryptFn,debug){var fallbackValue=null;try{var decryptedVal=decryptFn(value);if(isNullOrUndefined(decryptedVal)){return fallbackValue;}return JSON.parse(decryptedVal);}catch(err){if(debug){console.error('Error occurred during decryption: ',err);}return fallbackValue;}};var encryptBrowser=function encryptBrowser(value){return "".concat(ENCRYPTION_PREFIX_V3).concat(toBase64(value));};var decryptBrowser=function decryptBrowser(value){if(value!==null&&value!==void 0&&value.startsWith(ENCRYPTION_PREFIX_V3)){return fromBase64(value.substring(ENCRYPTION_PREFIX_V3.length));}return value;};var getEncryptedValueBrowser=function getEncryptedValueBrowser(value){var debug=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return getEncryptedValueInternal(value,encryptBrowser,debug);};var getDecryptedValueBrowser=function getDecryptedValueBrowser(value){var debug=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return getDecryptedValueInternal(value,decryptBrowser,debug);};var getDecryptedCookieBrowser=function getDecryptedCookieBrowser(cookieKey){var debug=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(Object.values(COOKIE_KEYS).includes(cookieKey)){return getDecryptedValueBrowser(cookie(cookieKey),debug);}return null;};var encrypt=function encrypt(value){return "".concat(ENCRYPTION_PREFIX_V3).concat(Buffer.from(value,'utf-8').toString('base64'));};var decrypt=function decrypt(value){if(value!==null&&value!==void 0&&value.startsWith(ENCRYPTION_PREFIX_V3)){return Buffer.from(value.substring(ENCRYPTION_PREFIX_V3.length),'base64').toString('utf-8');}return value;};var getDecryptedValue=function getDecryptedValue(value){var debug=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return getDecryptedValueInternal(value,decrypt,debug);};var getEncryptedValue=function getEncryptedValue(value){var debug=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return getEncryptedValueInternal(value,encrypt,debug);}; | ||
@@ -136,0 +136,0 @@ |
@@ -59,4 +59,2 @@ (function (global, factory) { | ||
const userIdKey='rl_user_id';const userTraitsKey='rl_trait';const anonymousUserIdKey='rl_anonymous_id';const groupIdKey='rl_group_id';const groupTraitsKey='rl_group_trait';const pageInitialReferrerKey='rl_page_init_referrer';const pageInitialReferringDomainKey='rl_page_init_referring_domain';const sessionInfoKey='rl_session';const authTokenKey='rl_auth_token';const COOKIE_KEYS={userId:userIdKey,userTraits:userTraitsKey,anonymousId:anonymousUserIdKey,groupId:groupIdKey,groupTraits:groupTraitsKey,initialReferrer:pageInitialReferrerKey,initialReferringDomain:pageInitialReferringDomainKey,sessionInfo:sessionInfoKey,authToken:authTokenKey};const ENCRYPTION_PREFIX_V3='RS_ENC_v3_'; | ||
/** | ||
@@ -81,2 +79,4 @@ * Encode. | ||
const userIdKey='rl_user_id';const userTraitsKey='rl_trait';const anonymousUserIdKey='rl_anonymous_id';const groupIdKey='rl_group_id';const groupTraitsKey='rl_group_trait';const pageInitialReferrerKey='rl_page_init_referrer';const pageInitialReferringDomainKey='rl_page_init_referring_domain';const sessionInfoKey='rl_session';const authTokenKey='rl_auth_token';const COOKIE_KEYS={userId:userIdKey,userTraits:userTraitsKey,anonymousId:anonymousUserIdKey,groupId:groupIdKey,groupTraits:groupTraitsKey,initialReferrer:pageInitialReferrerKey,initialReferringDomain:pageInitialReferringDomainKey,sessionInfo:sessionInfoKey,authToken:authTokenKey};const ENCRYPTION_PREFIX_V3='RS_ENC_v3_'; | ||
const getEncryptedValueInternal=(value,encryptFn,debug)=>{const fallbackValue=null;try{const strValue=stringifyWithoutCircular(value,false);if(isNull(strValue)){return null;}return encryptFn(strValue);}catch(err){if(debug){console.error('Error occurred during encryption: ',err);}return fallbackValue;}};const getDecryptedValueInternal=(value,decryptFn,debug)=>{const fallbackValue=null;try{const decryptedVal=decryptFn(value);if(isNullOrUndefined(decryptedVal)){return fallbackValue;}return JSON.parse(decryptedVal);}catch(err){if(debug){console.error('Error occurred during decryption: ',err);}return fallbackValue;}};const encryptBrowser=value=>`${ENCRYPTION_PREFIX_V3}${toBase64(value)}`;const decryptBrowser=value=>{if(value?.startsWith(ENCRYPTION_PREFIX_V3)){return fromBase64(value.substring(ENCRYPTION_PREFIX_V3.length));}return value;};const getEncryptedValueBrowser=(value,debug=false)=>getEncryptedValueInternal(value,encryptBrowser,debug);const getDecryptedValueBrowser=(value,debug=false)=>getDecryptedValueInternal(value,decryptBrowser,debug);const getDecryptedCookieBrowser=(cookieKey,debug=false)=>{if(Object.values(COOKIE_KEYS).includes(cookieKey)){return getDecryptedValueBrowser(cookie(cookieKey),debug);}return null;};const encrypt=value=>`${ENCRYPTION_PREFIX_V3}${Buffer.from(value,'utf-8').toString('base64')}`;const decrypt=value=>{if(value?.startsWith(ENCRYPTION_PREFIX_V3)){return Buffer.from(value.substring(ENCRYPTION_PREFIX_V3.length),'base64').toString('utf-8');}return value;};const getDecryptedValue=(value,debug=false)=>getDecryptedValueInternal(value,decrypt,debug);const getEncryptedValue=(value,debug=false)=>getEncryptedValueInternal(value,encrypt,debug); | ||
@@ -83,0 +83,0 @@ |
{ | ||
"name": "@rudderstack/analytics-js-cookies", | ||
"version": "0.4.16", | ||
"version": "0.4.17", | ||
"description": "RudderStack JavaScript SDK Cookies Utilities", | ||
@@ -5,0 +5,0 @@ "main": "dist/npm/modern/cjs/index.cjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81100