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

@magento/recommendations-js-sdk

Package Overview
Dependencies
Maintainers
7
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@magento/recommendations-js-sdk - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

27

dist/browser/index.js

@@ -1,2 +0,15 @@

parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"bSFJ":[function(require,module,exports) {
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"ZBnv":[function(require,module,exports) {
function n(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")}module.exports=n;
},{}],"No+o":[function(require,module,exports) {
function e(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}function r(r,n,t){return n&&e(r.prototype,n),t&&e(r,t),r}module.exports=r;
},{}],"KA2S":[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3];!function(t){"use strict";var r,e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag",u="object"==typeof module,h=t.regeneratorRuntime;if(h)u&&(module.exports=h);else{(h=t.regeneratorRuntime=u?module.exports:{}).wrap=w;var f="suspendedStart",s="suspendedYield",l="executing",p="completed",y={},v={};v[i]=function(){return this};var d=Object.getPrototypeOf,g=d&&d(d(P([])));g&&g!==e&&n.call(g,i)&&(v=g);var m=b.prototype=x.prototype=Object.create(v);E.prototype=m.constructor=b,b.constructor=E,b[c]=E.displayName="GeneratorFunction",h.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===E||"GeneratorFunction"===(r.displayName||r.name))},h.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(m),t},h.awrap=function(t){return{__await:t}},_(j.prototype),j.prototype[a]=function(){return this},h.AsyncIterator=j,h.async=function(t,r,e,n){var o=new j(w(t,r,e,n));return h.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},_(m),m[c]="Generator",m[i]=function(){return this},m.toString=function(){return"[object Generator]"},h.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},h.values=P,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(G),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(n,o){return c.type="throw",c.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),h=n.call(a,"finallyLoc");if(u&&h){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),G(e),y}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;G(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),y}}}function w(t,r,e,n){var o=r&&r.prototype instanceof x?r:x,i=Object.create(o.prototype),a=new N(n||[]);return i._invoke=function(t,r,e){var n=f;return function(o,i){if(n===l)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return F()}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var c=O(a,e);if(c){if(c===y)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(n===f)throw n=p,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n=l;var u=L(t,r,e);if("normal"===u.type){if(n=e.done?p:s,u.arg===y)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n=p,e.method="throw",e.arg=u.arg)}}}(t,e,a),i}function L(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(n){return{type:"throw",arg:n}}}function x(){}function E(){}function b(){}function _(t){["next","throw","return"].forEach(function(r){t[r]=function(t){return this._invoke(r,t)}})}function j(t){var r;this._invoke=function(e,o){function i(){return new Promise(function(r,i){!function r(e,o,i,a){var c=L(t[e],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&n.call(h,"__await")?Promise.resolve(h.__await).then(function(t){r("next",t,i,a)},function(t){r("throw",t,i,a)}):Promise.resolve(h).then(function(t){u.value=t,i(u)},function(t){return r("throw",t,i,a)})}a(c.arg)}(e,o,r,i)})}return r=r?r.then(i,i):i()}}function O(t,e){var n=t.iterator[e.method];if(n===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=r,O(t,e),"throw"===e.method))return y;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=L(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,y;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,y):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function G(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return a.next=a}}return{next:F}}function F(){return{value:r,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")());
},{}],"GCZq":[function(require,module,exports) {
var e=function(){return this||"object"==typeof self&&self}()||Function("return this")(),r=e.regeneratorRuntime&&Object.getOwnPropertyNames(e).indexOf("regeneratorRuntime")>=0,t=r&&e.regeneratorRuntime;if(e.regeneratorRuntime=void 0,module.exports=require("./runtime"),r)e.regeneratorRuntime=t;else try{delete e.regeneratorRuntime}catch(n){e.regeneratorRuntime=void 0}
},{"./runtime":"KA2S"}],"8m4e":[function(require,module,exports) {
module.exports=require("regenerator-runtime");
},{"regenerator-runtime":"GCZq"}],"2fws":[function(require,module,exports) {
function n(n,t,o,r,e,i,u){try{var c=n[i](u),v=c.value}catch(a){return void o(a)}c.done?t(v):Promise.resolve(v).then(r,e)}function t(t){return function(){var o=this,r=arguments;return new Promise(function(e,i){var u=t.apply(o,r);function c(t){n(u,e,i,c,v,"next",t)}function v(t){n(u,e,i,c,v,"throw",t)}c(void 0)})}}module.exports=t;
},{}],"bSFJ":[function(require,module,exports) {
"use strict";function e(e,t){return t=t||{},new Promise(function(n,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(JSON.parse(s.responseText))},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var l in s.open(t.method||"get",e,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){o.push(t=t.toLowerCase()),u.push([t,n]),i[t]=i[t]?i[t]+","+n:n}),n(a())},s.onerror=r,s.withCredentials="include"==t.credentials,t.headers)s.setRequestHeader(l,t.headers[l]);s.send(t.body||null)})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;

@@ -8,4 +21,4 @@ },{}],"j9gh":[function(require,module,exports) {

},{}],"4dYt":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getRecommendations=exports.ping=void 0;var e=r(require("isomorphic-unfetch")),t=require("./urls");function r(e){return e&&e.__esModule?e:{default:e}}function n(e,t,r,n,o,s,u){try{var i=e[s](u),a=i.value}catch(c){return void r(c)}i.done?t(a):Promise.resolve(a).then(n,o)}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,s){var u=e.apply(t,r);function i(e){n(u,o,s,i,a,"next",e)}function a(e){n(u,o,s,i,a,"throw",e)}i(void 0)})}}var s=function(){var r=o(regeneratorRuntime.mark(function r(){var n,o,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,e.default)(t.API_PING_URL);case 2:return n=r.sent,r.next=5,n.text();case 5:return o=r.sent,s={status:n.status,data:o},r.abrupt("return",s);case 8:case"end":return r.stop()}},r)}));return function(){return r.apply(this,arguments)}}();exports.ping=s;var u=function(){var r=o(regeneratorRuntime.mark(function r(){var n,o,s,u,i,a,c,d,v,p,f,h,l,m,x,w,y,S,g,k,P,R,C,_=arguments;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=_.length>0&&void 0!==_[0]?_[0]:{},o=n.instanceId,s=void 0===o?"":o,u=n.cartSkus,i=void 0===u?[]:u,a=n.currentSku,c=void 0===a?"":a,d=n.storeCode,v=void 0===d?"":d,p=n.storeViewCode,f=void 0===p?"":p,h=n.units,l=void 0===h?[]:h,m=n.userPurchaseHistorySkus,x=void 0===m?[]:m,w=n.userViewHistorySkus,y=void 0===w?[]:w,S=n.websiteCode,g={instanceId:s,cartSkus:i,currentSku:c,storeCode:v,storeViewCode:f,units:l,userPurchaseHistorySkus:x,userViewHistorySkus:y,websiteCode:void 0===S?"":S},k={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)},r.next=5,(0,e.default)(t.API_RECOMMENDATIONS_URL,k);case 5:return P=r.sent,r.next=8,P.json();case 8:return R=r.sent,C={status:P.status,data:R},r.abrupt("return",C);case 11:case"end":return r.stop()}},r)}));return function(){return r.apply(this,arguments)}}();exports.getRecommendations=u;
},{"isomorphic-unfetch":"j9gh","./urls":"KOnE"}],"3pLy":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getRecommendations=exports.ping=void 0;var e=s(require("@babel/runtime/regenerator")),t=s(require("@babel/runtime/helpers/asyncToGenerator")),r=s(require("isomorphic-unfetch")),n=require("./urls");function s(e){return e&&e.__esModule?e:{default:e}}var u=function(){var s=(0,t.default)(e.default.mark(function t(){var s,u,o;return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,r.default)(n.API_PING_URL);case 2:return s=e.sent,e.next=5,s.text();case 5:return u=e.sent,o={status:s.status,data:u},e.abrupt("return",o);case 8:case"end":return e.stop()}},t)}));return function(){return s.apply(this,arguments)}}();exports.ping=u;var o=function(){var s=(0,t.default)(e.default.mark(function t(){var s,u,o,a,i,d,c,p,f,v,l,h,x,y,S,b,k,m,w,C,_,g,P,I=arguments;return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=I.length>0&&void 0!==I[0]?I[0]:{},u=s.instanceId,o=void 0===u?"":u,a=s.cartSkus,i=void 0===a?[]:a,d=s.currentSku,c=void 0===d?"":d,p=s.storeCode,f=void 0===p?"":p,v=s.storeViewCode,l=void 0===v?"":v,h=s.units,x=void 0===h?[]:h,y=s.userPurchaseHistorySkus,S=void 0===y?[]:y,b=s.userViewHistorySkus,k=void 0===b?[]:b,m=s.websiteCode,w={instanceId:o,cartSkus:i,currentSku:c,storeCode:f,storeViewCode:l,units:x,userPurchaseHistorySkus:S,userViewHistorySkus:k,websiteCode:void 0===m?"":m},C={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)},e.next=5,(0,r.default)(n.API_RECOMMENDATIONS_URL,C);case 5:return _=e.sent,e.next=8,_.json();case 8:return g=e.sent,P={status:_.status,data:g},e.abrupt("return",P);case 11:case"end":return e.stop()}},t)}));return function(){return s.apply(this,arguments)}}();exports.getRecommendations=o;
},{"@babel/runtime/regenerator":"8m4e","@babel/runtime/helpers/asyncToGenerator":"2fws","isomorphic-unfetch":"j9gh","./urls":"KOnE"}],"3pLy":[function(require,module,exports) {
var define;

@@ -21,6 +34,6 @@ var global = arguments[3];

},{"./lib/rng":"ogM3","./lib/bytesToUuid":"O4sp"}],"zyfB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RecommendationsClient=void 0;var e=require("./api"),t=n(require("mustache")),i=n(require("uuid/v4"));function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function u(e,t,i){return t&&s(e.prototype,t),i&&s(e,i),e}var o=function(){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.instanceId,i=void 0===t?"":t,s=e.storeCode,u=void 0===s?"":s,o=e.storeViewCode,d=void 0===o?"":o,a=e.websiteCode,c=void 0===a?"":a;r(this,n),this._instanceId=i,this._storeCode=u,this._storeViewCode=d,this._websiteCode=c,this.units=[]}return u(n,[{key:"registerUnit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.unitName,n=void 0===t?"":t,r=e.filterQueryString,s=void 0===r?null:r,u=e.limit,o=void 0===u?null:u,d=e.rankerBlended,a=void 0===d?[]:d,c={unitInstanceId:(0,i.default)(),unitName:n,filterQueryString:s,limit:o,rankerBlended:a};return this.units.push(c),c}},{key:"unregisterUnit",value:function(e){var t=this.units.find(function(t){return t.unitInstanceId===e}),i=this.units.indexOf(t);return this.units.splice(i,1),t}},{key:"fetchUnits",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.currentSku,n=void 0===i?"":i,r=t.cartSkus,s=void 0===r?[]:r,u=t.userViewHistorySkus,o=void 0===u?[]:u,d=t.userPurchaseHistorySkus,a=void 0===d?[]:d,c={instanceId:this._instanceId,cartSkus:s,currentSku:n,storeCode:this._storeCode,storeViewCode:this._storeViewCode,units:this.units,userPurchaseHistorySkus:a,userViewHistorySkus:o,websiteCode:this._websiteCode};return(0,e.getRecommendations)(c)}},{key:"renderUnit",value:function(e,i){return t.default.render(e,i)}}]),n}();exports.RecommendationsClient=o;
},{"./api":"4dYt","mustache":"3pLy","uuid/v4":"37UO"}],"Focm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/api");Object.keys(e).forEach(function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(exports,r,{enumerable:!0,get:function(){return e[r]}})});var r=require("./src/client");Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})});
},{"./src/api":"4dYt","./src/client":"zyfB"}]},{},["Focm"], null)
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RecommendationsClient=void 0;var e=s(require("@babel/runtime/helpers/classCallCheck")),t=s(require("@babel/runtime/helpers/createClass")),i=require("./api"),n=s(require("mustache")),r=s(require("uuid/v4"));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){return window&&window.dsDataLayer?window.dsDataLayer.storefrontInstanceContext[e]:""},o=function(){function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.instanceId,n=void 0===i?u("instanceId"):i,r=t.storeCode,o=void 0===r?u("storeCode"):r,d=t.storeViewCode,a=void 0===d?u("storeViewCode"):d,l=t.websiteCode,c=void 0===l?u("websiteCode"):l;(0,e.default)(this,s),this._instanceId=n,this._storeCode=o,this._storeViewCode=a,this._websiteCode=c,this.units=[]}return(0,t.default)(s,[{key:"registerUnit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.unitName,i=void 0===t?"":t,n=e.filterQueryString,s=void 0===n?null:n,u=e.limit,o=void 0===u?null:u,d=e.rankerBlended,a=void 0===d?[]:d,l={unitInstanceId:(0,r.default)(),unitName:i,filterQueryString:s,limit:o,rankerBlended:a};return this.units.push(l),l}},{key:"unregisterUnit",value:function(e){var t=this.units.find(function(t){return t.unitInstanceId===e}),i=this.units.indexOf(t);return this.units.splice(i,1),t}},{key:"fetchUnits",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.currentSku,n=void 0===t?"":t,r=e.cartSkus,s=void 0===r?[]:r,u=e.userViewHistorySkus,o=void 0===u?[]:u,d=e.userPurchaseHistorySkus,a=void 0===d?[]:d,l={instanceId:this._instanceId,cartSkus:s,currentSku:n,storeCode:this._storeCode,storeViewCode:this._storeViewCode,units:this.units,userPurchaseHistorySkus:a,userViewHistorySkus:o,websiteCode:this._websiteCode};return(0,i.getRecommendations)(l)}},{key:"renderUnit",value:function(e,t){return n.default.render(e,t)}}]),s}();exports.RecommendationsClient=o;
},{"@babel/runtime/helpers/classCallCheck":"ZBnv","@babel/runtime/helpers/createClass":"No+o","./api":"4dYt","mustache":"3pLy","uuid/v4":"37UO"}],"Focm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/client");Object.keys(e).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})}),"undefined"!=typeof window&&(window.RecommendationsClient=e.RecommendationsClient);
},{"./src/client":"zyfB"}]},{},["Focm"], null)
//# sourceMappingURL=/index.js.map

@@ -6,6 +6,6 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"KOnE":[function(require,module,exports) {

},{"./urls":"KOnE"}],"zyfB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RecommendationsClient=void 0;var e=require("./api"),t=i(require("mustache")),s=i(require("uuid/v4"));function i(e){return e&&e.__esModule?e:{default:e}}class r{constructor({instanceId:e="",storeCode:t="",storeViewCode:s="",websiteCode:i=""}={}){this._instanceId=e,this._storeCode=t,this._storeViewCode=s,this._websiteCode=i,this.units=[]}registerUnit({unitName:e="",filterQueryString:t=null,limit:i=null,rankerBlended:r=[]}={}){const n={unitInstanceId:(0,s.default)(),unitName:e,filterQueryString:t,limit:i,rankerBlended:r};return this.units.push(n),n}unregisterUnit(e){const t=this.units.find(t=>t.unitInstanceId===e),s=this.units.indexOf(t);return this.units.splice(s,1),t}fetchUnits({currentSku:t="",cartSkus:s=[],userViewHistorySkus:i=[],userPurchaseHistorySkus:r=[]}={}){const n={instanceId:this._instanceId,cartSkus:s,currentSku:t,storeCode:this._storeCode,storeViewCode:this._storeViewCode,units:this.units,userPurchaseHistorySkus:r,userViewHistorySkus:i,websiteCode:this._websiteCode};return(0,e.getRecommendations)(n)}renderUnit(e,s){return t.default.render(e,s)}}exports.RecommendationsClient=r;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RecommendationsClient=void 0;var e=require("./api"),t=i(require("mustache")),s=i(require("uuid/v4"));function i(e){return e&&e.__esModule?e:{default:e}}const r=e=>{if(!window||!window.dsDataLayer)return"";return window.dsDataLayer.storefrontInstanceContext[e]};class n{constructor({instanceId:e=r("instanceId"),storeCode:t=r("storeCode"),storeViewCode:s=r("storeViewCode"),websiteCode:i=r("websiteCode")}={}){this._instanceId=e,this._storeCode=t,this._storeViewCode=s,this._websiteCode=i,this.units=[]}registerUnit({unitName:e="",filterQueryString:t=null,limit:i=null,rankerBlended:r=[]}={}){const n={unitInstanceId:(0,s.default)(),unitName:e,filterQueryString:t,limit:i,rankerBlended:r};return this.units.push(n),n}unregisterUnit(e){const t=this.units.find(t=>t.unitInstanceId===e),s=this.units.indexOf(t);return this.units.splice(s,1),t}fetchUnits({currentSku:t="",cartSkus:s=[],userViewHistorySkus:i=[],userPurchaseHistorySkus:r=[]}={}){const n={instanceId:this._instanceId,cartSkus:s,currentSku:t,storeCode:this._storeCode,storeViewCode:this._storeViewCode,units:this.units,userPurchaseHistorySkus:r,userViewHistorySkus:i,websiteCode:this._websiteCode};return(0,e.getRecommendations)(n)}renderUnit(e,s){return t.default.render(e,s)}}exports.RecommendationsClient=n;
},{"./api":"4dYt"}],"Focm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/api");Object.keys(e).forEach(function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(exports,r,{enumerable:!0,get:function(){return e[r]}})});var r=require("./src/client");Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})});
},{"./src/api":"4dYt","./src/client":"zyfB"}]},{},["Focm"], null)
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/client");Object.keys(e).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})}),"undefined"!=typeof window&&(window.RecommendationsClient=e.RecommendationsClient);
},{"./src/client":"zyfB"}]},{},["Focm"], null)
//# sourceMappingURL=/index.js.map
{
"name": "@magento/recommendations-js-sdk",
"version": "0.0.13",
"version": "0.0.14",
"description": "📚 JavaScript library for retrieving and displaying Magento product recommendations.",

@@ -39,3 +39,3 @@ "keywords": [

"deploy": "npm publish --access public",
"test": "jest --verbose",
"test": "jest --passWithNoTests --verbose",
"lint": "eslint .",

@@ -53,2 +53,3 @@ "lint:fix": "eslint --fix .",

"@babel/core": "^7.5.5",
"@babel/plugin-transform-runtime": "^7.6.0",
"@babel/preset-env": "^7.5.5",

@@ -55,0 +56,0 @@ "babel-jest": "^24.9.0",

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