New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@adobe-mcid/visitor-js-server

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adobe-mcid/visitor-js-server - npm Package Compare versions

Comparing version

to
0.0.9

19

lib/amcv-cookie.js

@@ -1,3 +0,18 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!(i&&_arr.length===i));_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i["return"]&&_i["return"]()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target};// TODO Consider moving this logic into `visitor-js-shared`.
/*
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!(i&&_arr.length===i));_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i["return"]&&_i["return"]()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target};/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2016 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property
* laws, including trade secret and copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************//*

@@ -4,0 +19,0 @@ AMCV Cookie Format:

@@ -1,4 +0,20 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _utils=require("./utils");function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}// Target adapter will transform an object into the format of `targetSchema`.
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _utils=require("./utils");function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2016 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property
* laws, including trade secret and copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/// Target adapter will transform an object into the format of `targetSchema`.
function adapt(a){var b=renameKeys(a,payloadToTargetKeyMap),c=createTargetSchema();return populateCustomerIDs(c,b),populate(c,b)}exports.default={adapt:adapt};// Helpers and Consts:
var ID_KEY_BASE="vst",ID_KEY_SEPARATOR=".",payloadToTargetKeyMap={MCMID:"marketingCloudVisitorId",MCAAMB:"mboxAAMB",MCAAMLH:"mboxMCGLH",sdid:"mboxMCSDID"};function createTargetSchema(){return{marketingCloudVisitorId:void 0,mboxParameters:{mboxAAMB:void 0,mboxMCGLH:void 0,mboxMCSDID:void 0}}}function renameKeys(a,b){return Object.assign.apply(Object,[{}].concat(_toConsumableArray(Object.keys(a).map(function(c){var d=b[c]?b[c]:c;return _defineProperty({},d,a[c])}))))}function populateCustomerIDs(a,_ref2){var _ref2$customerIDs=_ref2.customerIDs,b=_ref2$customerIDs===void 0?{}:_ref2$customerIDs;(0,_utils.forEachKey)(b,function(c){var d=""+ID_KEY_BASE+ID_KEY_SEPARATOR+c,e=b[c];// If value is an object, populate this id in schema per this object's keys.
(0,_utils.isObject)(e)?(0,_utils.forEachKey)(e,function(f){var g=""+d+ID_KEY_SEPARATOR+f;a.mboxParameters[g]=e[f]}):a.mboxParameters[d]=e})}function populate(a,b){return Object.keys(a).forEach(function(c){(0,_utils.isObject)(a[c])?populate(a[c],b):b.hasOwnProperty(c)&&(a[c]=b[c])}),(0,_utils.filterBadProps)(a)}module.exports=exports["default"];

@@ -1,1 +0,17 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var throwError=exports.throwError=function throwError(a){throw new Error(a)};var normalizeOrgId=exports.normalizeOrgId=function normalizeOrgId(a){return 0>a.indexOf("@")?a+"@AdobeOrg":a};var isObject=exports.isObject=function isObject(a){return a===Object(a)};var filterBadProps=exports.filterBadProps=function filterBadProps(a){return JSON.parse(JSON.stringify(a))};var forEachKey=exports.forEachKey=function forEachKey(a,b){Object.keys(a).forEach(b)};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2016 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property
* laws, including trade secret and copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/var throwError=exports.throwError=function throwError(a){throw new Error(a)};var normalizeOrgId=exports.normalizeOrgId=function normalizeOrgId(a){return 0>a.indexOf("@")?a+"@AdobeOrg":a};var isObject=exports.isObject=function isObject(a){return a===Object(a)};var filterBadProps=exports.filterBadProps=function filterBadProps(a){return JSON.parse(JSON.stringify(a))};var forEachKey=exports.forEachKey=function forEachKey(a,b){Object.keys(a).forEach(b)};

@@ -1,1 +0,17 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default=createVisitorPayload;function createVisitorPayload(_ref,d){var a=_ref.sdid,_ref$amcvValues=_ref.amcvValues,c=_ref$amcvValues===void 0?{}:_ref$amcvValues,b=_ref.customerIDs,e=Object.assign(Object.create(null),{sdid:a},c,{customerIDs:b});return d.adapt(e)}module.exports=exports["default"];
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default=createVisitorPayload;/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2016 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property
* laws, including trade secret and copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/function createVisitorPayload(_ref,d){var a=_ref.sdid,_ref$amcvValues=_ref.amcvValues,c=_ref$amcvValues===void 0?{}:_ref$amcvValues,b=_ref.customerIDs,e=Object.assign(Object.create(null),{sdid:a},c,{customerIDs:b});return d.adapt(e)}module.exports=exports["default"];

@@ -1,1 +0,17 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _visitorJsShared=require("@adobe-mcid/visitor-js-shared"),_amcvCookie=require("./amcv-cookie"),_targetAdapter=require("./target-adapter"),_targetAdapter2=_interopRequireDefault(_targetAdapter),_visitorPayload=require("./visitor-payload"),_visitorPayload2=_interopRequireDefault(_visitorPayload),_utils=require("./utils");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var CONSUMER_ID_BASE="payload:",AMCV_PREFIX="AMCV_";function Visitor(){var a=0>=arguments.length||void 0===arguments[0]?(0,_utils.throwError)("Visitor requires an Org ID!"):arguments[0],b={},c=(0,_utils.normalizeOrgId)(a),d=function d(g){return b=Object.assign({},b,g)},e=(0,_visitorJsShared.supplementalDataIDFactory)(),f=function f(){var g=0>=arguments.length||void 0===arguments[0]?(0,_utils.throwError)("sdidConsumerID is required"):arguments[0],h=e.getID(""+CONSUMER_ID_BASE+g),i=e.getState();return d({sdid:i}),h};this.generatePayload=function(_ref){var g=_ref.sdidConsumerID,h=_ref.amcvCookie,i=f(g),j=(0,_amcvCookie.pickValues)(h,["MCMID","MCAAMB","MCAAMLH"]),_b=b,k=_b.customerIDs;return(0,_visitorPayload2.default)({sdid:i,amcvValues:j,customerIDs:k},_targetAdapter2.default)},this.setCustomerIDs=function(){var g=0>=arguments.length||void 0===arguments[0]?{}:arguments[0];d({customerIDs:g})},this.getState=function(){return _defineProperty({},c,b)},this.getCookieName=function(){return AMCV_PREFIX+c}}Visitor.AuthState=_visitorJsShared.AuthState;exports.default=Visitor;module.exports=exports["default"];
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _visitorJsShared=require("@adobe-mcid/visitor-js-shared"),_amcvCookie=require("./amcv-cookie"),_targetAdapter=require("./target-adapter"),_targetAdapter2=_interopRequireDefault(_targetAdapter),_visitorPayload=require("./visitor-payload"),_visitorPayload2=_interopRequireDefault(_visitorPayload),_utils=require("./utils");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2016 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property
* laws, including trade secret and copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/var CONSUMER_ID_BASE="payload:",AMCV_PREFIX="AMCV_";function Visitor(){var a=0>=arguments.length||void 0===arguments[0]?(0,_utils.throwError)("Visitor requires an Org ID!"):arguments[0],b={},c=(0,_utils.normalizeOrgId)(a),d=function d(g){return b=Object.assign({},b,g)},e=(0,_visitorJsShared.supplementalDataIDFactory)(),f=function f(){var g=0>=arguments.length||void 0===arguments[0]?(0,_utils.throwError)("sdidConsumerID is required"):arguments[0],h=e.getID(""+CONSUMER_ID_BASE+g),i=e.getState();return d({sdid:i}),h};this.generatePayload=function(_ref){var g=_ref.sdidConsumerID,h=_ref.amcvCookie,i=f(g),j=(0,_amcvCookie.pickValues)(h,["MCMID","MCAAMB","MCAAMLH"]),_b=b,k=_b.customerIDs;return(0,_visitorPayload2.default)({sdid:i,amcvValues:j,customerIDs:k},_targetAdapter2.default)},this.setCustomerIDs=function(){var g=0>=arguments.length||void 0===arguments[0]?{}:arguments[0];d({customerIDs:g})},this.getState=function(){return _defineProperty({},c,b)},this.getCookieName=function(){return AMCV_PREFIX+c}}Visitor.AuthState=_visitorJsShared.AuthState;exports.default=Visitor;module.exports=exports["default"];

2

package.json
{
"name": "@adobe-mcid/visitor-js-server",
"version": "0.0.8",
"version": "0.0.9",
"description": "Server compatible Visitor ID service",

@@ -5,0 +5,0 @@ "main": "lib/Visitor.js",