Comparing version 0.10.0 to 0.10.1
{ | ||
"name": "sajari", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "JavaScript SDK for the Sajari search API", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,1 +0,1 @@ | ||
module.exports=function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="/",t(0)}([function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){return{text:e,weight:t||1}}function o(e,t,n){return[e,{metric:{field:t,type:n}}]}function u(e,t){return[e,{count:{field:t}}]}function s(e,t){return{name:e,filter:t}}function a(e,t){return[e,{bucket:{buckets:t}}]}function c(e,t,n){return{field:{field:e,value:t instanceof Array?{multiple:t.map(String)}:{single:String(t)},operator:n}}}function l(e,t){return{combinator:{filters:e,operator:t}}}function _(e,t){return{field:{field:e,value:t}}}function f(e){return{score:{threshold:e}}}function E(e,t){return{filter:{filter:e,value:t}}}function d(e,t){return{add:{field_boost:e,value:t}}}function O(e,t,n,i,r,o,u){return{geo:{field_lat:e,field_lng:t,lat:n,lng:i,radius:r,value:o,region:u}}}function T(e,t){return{point:e,value:t}}function I(e,t){return{interval:{field:e,points:t}}}function p(e,t,n,i,r){return{distance:{min:e,max:t,ref:n,field:i,value:r}}}function h(e,t){return{element:{field:e,elts:t}}}function g(e,t){return{text:{field:e,text:t}}}function v(e,t){return{field:e,order:t}}function R(e){return{identifier:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Query=t.SORT_DESCENDING=t.SORT_ASCENDING=t.GEO_FIELD_BOOST_REGION_OUTSIDE=t.GEO_FIELD_BOOST_REGION_INSIDE=t.COMB_FILTER_OP_NONE=t.COMB_FILTER_OP_ONE=t.COMB_FILTER_OP_ANY=t.COMB_FILTER_OP_ALL=t.FILTER_OP_PREFIX=t.FILTER_OP_SUFFIX=t.FILTER_OP_NOT_CONTAIN=t.FILTER_OP_CONTAINS=t.FILTER_OP_LT_EQ=t.FILTER_OP_LT=t.FILTER_OP_GT_EQ=t.FILTER_OP_GT=t.FILTER_OP_NOT_EQ=t.FILTER_OP_EQ=t.METRIC_TYPE_SUM=t.METRIC_TYPE_AVG=t.METRIC_TYPE_MIN=t.METRIC_TYPE_MAX=t.Api=void 0;var N=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();t.body=r,t.metricAggregate=o,t.countAggregate=u,t.bucket=s,t.bucketAggregate=a,t.fieldFilter=c,t.combinatorFilter=l,t.fieldInstanceBoost=_,t.scoreInstanceBoost=f,t.filterFieldBoost=E,t.additiveFieldBoost=d,t.geoFieldBoost=O,t.pointValue=T,t.intervalFieldBoost=I,t.distanceFieldBoost=p,t.elementFieldBoost=h,t.textFieldBoost=g,t.sort=v,t.transform=R;var F=n(1),L=(t.Api=function(){function e(t,n,r){i(this,e),this.p=t,this.c=n,this.a=r||"https://apid.sajari.com:9200/search/"}return N(e,[{key:"search",value:function(e,t){return fetch(this.a,{method:"POST",body:JSON.stringify({searchRequest:{searchRequest:e.q,tracking:{type:e.generate_tokens,field:e.token_key_field,sequence:e.s++,query_id:e.i,data:e.d}},project:this.p,collection:this.c})}).then(function(e){e.ok?e.json().then(function(e){for(var n=e.searchResponse.results||[],i=0;i<n.length;i++){for(var r in n[i].values)n[i].values[r]=n[i].values[r].single?n[i].values[r].single:n[i].values[r].multiple;e.tokens&&(n[i].tokens=e.tokens[i])}t(null,e)}):e.text().then(function(e){return t(e,null)})})["catch"](function(e){return t("Error during fetch: "+e.message,null)})}}]),e}(),t.METRIC_TYPE_MAX="MAX",t.METRIC_TYPE_MIN="MIN",t.METRIC_TYPE_AVG="AVG",t.METRIC_TYPE_SUM="SUM",t.FILTER_OP_EQ="EQUAL_TO",t.FILTER_OP_NOT_EQ="DOES_NOT_EQUAL",t.FILTER_OP_GT="GREATER_THAN",t.FILTER_OP_GT_EQ="GREATER_THAN_OR_EQUAL_TO",t.FILTER_OP_LT="LESS_THAN",t.FILTER_OP_LT_EQ="LESS_THAN_OR_EQUAL_TO",t.FILTER_OP_CONTAINS="CONTAINS",t.FILTER_OP_NOT_CONTAIN="DOES_NOT_CONTAIN",t.FILTER_OP_SUFFIX="HAS_SUFFIX",t.FILTER_OP_PREFIX="HAS_PREFX",t.COMB_FILTER_OP_ALL="ALL",t.COMB_FILTER_OP_ANY="ANY",t.COMB_FILTER_OP_ONE="ONE",t.COMB_FILTER_OP_NONE="NONE",t.GEO_FIELD_BOOST_REGION_INSIDE="INSIDE",t.GEO_FIELD_BOOST_REGION_OUTSIDE="OUTSIDE",t.SORT_ASCENDING="ASC",t.SORT_DESCENDING="DESC",function(){function e(){i(this,e),this.resetID(),this.q={page:1,results_per_page:10},this.d={};var t=(0,F.getGAID)();t&&this.data("gaID",t)}return N(e,[{key:"resetID",value:function(){this.i="",this.s=0;for(var e=0;e<16;e++)this.i+="abcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(36*Math.random()))}},{key:"resultsPerPage",value:function(e){this.q.results_per_page=e}},{key:"page",value:function(e){this.q.page=e}},{key:"body",value:function(e){this.q.body=e}},{key:"fields",value:function(e){this.q.fields=e}},{key:"filter",value:function(e){this.q.filter=e}},{key:"fieldBoosts",value:function(e){this.q.field_boosts=e}},{key:"instanceBoosts",value:function(e){this.q.instance_boosts=e}},{key:"aggregates",value:function(e){for(var t={},n=0;n<e.length;n++)t[e[n][0]]=e[n][1];this.q.aggregates=t}},{key:"sort",value:function(e){this.q.sort=e}},{key:"transforms",value:function(e){this.q.transforms=e}},{key:"tracking",value:function(e,t,n){this.type=e,this.field=t}},{key:"posNeg",value:function(e){this.generate_tokens="POS_NEG",this.token_key_field=e}},{key:"click",value:function(e){this.generate_tokens="CLICK",this.token_key_field=e}},{key:"data",value:function(e,t){this.d[e]=t}}]),e}());t.Query=L},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(){var e="",t=u["default"].get("_ga");if(void 0!==t){var n=t.split(".");n.length>2&&(e=n[2])}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.getGAID=r;var o=n(2),u=i(o)},function(e,t,n){var i,r;!function(o){var u=!1;if(i=o,r="function"==typeof i?i.call(t,n,t,e):i,!(void 0!==r&&(e.exports=r)),u=!0,e.exports=o(),u=!0,!u){var s=window.Cookies,a=window.Cookies=o();a.noConflict=function(){return window.Cookies=s,a}}}(function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function t(n){function i(t,r,o){var u;if("undefined"!=typeof document){if(arguments.length>1){if(o=e({path:"/"},i.defaults,o),"number"==typeof o.expires){var s=new Date;s.setMilliseconds(s.getMilliseconds()+864e5*o.expires),o.expires=s}try{u=JSON.stringify(r),/^[\{\[]/.test(u)&&(r=u)}catch(a){}return r=n.write?n.write(r,t):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape),document.cookie=[t,"=",r,o.expires?"; expires="+o.expires.toUTCString():"",o.path?"; path="+o.path:"",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("")}t||(u={});for(var c=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,_=0;_<c.length;_++){var f=c[_].split("="),E=f.slice(1).join("=");'"'===E.charAt(0)&&(E=E.slice(1,-1));try{var d=f[0].replace(l,decodeURIComponent);if(E=n.read?n.read(E,d):n(E,d)||E.replace(l,decodeURIComponent),this.json)try{E=JSON.parse(E)}catch(a){}if(t===d){u=E;break}t||(u[d]=E)}catch(a){}}return u}}return i.set=i,i.get=function(e){return i.call(i,e)},i.getJSON=function(){return i.apply({json:!0},[].slice.call(arguments))},i.defaults={},i.remove=function(t,n){i(t,"",e(n,{expires:-1}))},i.withConverter=t,i}return t(function(){})})}]); | ||
module.exports=function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="/",t(0)}([function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){return{text:e,weight:t||1}}function o(e,t,n){return[e,{metric:{field:t,type:n}}]}function u(e,t){return[e,{count:{field:t}}]}function s(e,t){return{name:e,filter:t}}function a(e,t){return[e,{bucket:{buckets:t}}]}function c(e,t,n){return{field:{field:e,value:t instanceof Array?{multiple:t.map(String)}:{single:String(t)},operator:n}}}function l(e,t){return{combinator:{filters:e,operator:t}}}function _(e,t){return{field:{field:e,value:t}}}function f(e,t){return{score:{threshold:e,min_count:t}}}function E(e,t){return{filter:{filter:e,value:t}}}function d(e,t){return{add:{field_boost:e,value:t}}}function O(e,t,n,i,r,o,u){return{geo:{field_lat:e,field_lng:t,lat:n,lng:i,radius:r,value:o,region:u}}}function T(e,t){return{point:e,value:t}}function I(e,t){return{interval:{field:e,points:t}}}function p(e,t,n,i,r){return{distance:{min:e,max:t,ref:n,field:i,value:r}}}function h(e,t){return{element:{field:e,elts:t}}}function g(e,t){return{text:{field:e,text:t}}}function v(e,t){return{field:e,order:t}}function R(e){return{identifier:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Query=t.SORT_DESCENDING=t.SORT_ASCENDING=t.GEO_FIELD_BOOST_REGION_OUTSIDE=t.GEO_FIELD_BOOST_REGION_INSIDE=t.COMB_FILTER_OP_NONE=t.COMB_FILTER_OP_ONE=t.COMB_FILTER_OP_ANY=t.COMB_FILTER_OP_ALL=t.FILTER_OP_PREFIX=t.FILTER_OP_SUFFIX=t.FILTER_OP_NOT_CONTAIN=t.FILTER_OP_CONTAINS=t.FILTER_OP_LT_EQ=t.FILTER_OP_LT=t.FILTER_OP_GT_EQ=t.FILTER_OP_GT=t.FILTER_OP_NOT_EQ=t.FILTER_OP_EQ=t.METRIC_TYPE_SUM=t.METRIC_TYPE_AVG=t.METRIC_TYPE_MIN=t.METRIC_TYPE_MAX=t.Api=void 0;var N=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();t.body=r,t.metricAggregate=o,t.countAggregate=u,t.bucket=s,t.bucketAggregate=a,t.fieldFilter=c,t.combinatorFilter=l,t.fieldInstanceBoost=_,t.scoreInstanceBoost=f,t.filterFieldBoost=E,t.additiveFieldBoost=d,t.geoFieldBoost=O,t.pointValue=T,t.intervalFieldBoost=I,t.distanceFieldBoost=p,t.elementFieldBoost=h,t.textFieldBoost=g,t.sort=v,t.transform=R;var F=n(1),L=(t.Api=function(){function e(t,n,r){i(this,e),this.p=t,this.c=n,this.a=r||"https://apid.sajari.com:9200/search/"}return N(e,[{key:"search",value:function(e,t){return fetch(this.a,{method:"POST",body:JSON.stringify({searchRequest:{searchRequest:e.q,tracking:{type:e.generate_tokens,field:e.token_key_field,sequence:e.s++,query_id:e.i,data:e.d}},project:this.p,collection:this.c})}).then(function(e){e.ok?e.json().then(function(e){for(var n=e.searchResponse.results||[],i=0;i<n.length;i++){for(var r in n[i].values)n[i].values[r]=n[i].values[r].single?n[i].values[r].single:n[i].values[r].multiple;e.tokens&&(n[i].tokens=e.tokens[i])}t(null,e)}):e.text().then(function(e){return t(e,null)})})["catch"](function(e){return t("Error during fetch: "+e.message,null)})}}]),e}(),t.METRIC_TYPE_MAX="MAX",t.METRIC_TYPE_MIN="MIN",t.METRIC_TYPE_AVG="AVG",t.METRIC_TYPE_SUM="SUM",t.FILTER_OP_EQ="EQUAL_TO",t.FILTER_OP_NOT_EQ="DOES_NOT_EQUAL",t.FILTER_OP_GT="GREATER_THAN",t.FILTER_OP_GT_EQ="GREATER_THAN_OR_EQUAL_TO",t.FILTER_OP_LT="LESS_THAN",t.FILTER_OP_LT_EQ="LESS_THAN_OR_EQUAL_TO",t.FILTER_OP_CONTAINS="CONTAINS",t.FILTER_OP_NOT_CONTAIN="DOES_NOT_CONTAIN",t.FILTER_OP_SUFFIX="HAS_SUFFIX",t.FILTER_OP_PREFIX="HAS_PREFX",t.COMB_FILTER_OP_ALL="ALL",t.COMB_FILTER_OP_ANY="ANY",t.COMB_FILTER_OP_ONE="ONE",t.COMB_FILTER_OP_NONE="NONE",t.GEO_FIELD_BOOST_REGION_INSIDE="INSIDE",t.GEO_FIELD_BOOST_REGION_OUTSIDE="OUTSIDE",t.SORT_ASCENDING="ASC",t.SORT_DESCENDING="DESC",function(){function e(){i(this,e),this.resetID(),this.q={page:1,results_per_page:10},this.d={};var t=(0,F.getGAID)();t&&this.data("gaID",t)}return N(e,[{key:"resetID",value:function(){this.i="",this.s=0;for(var e=0;e<16;e++)this.i+="abcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(36*Math.random()))}},{key:"resultsPerPage",value:function(e){this.q.results_per_page=e}},{key:"page",value:function(e){this.q.page=e}},{key:"body",value:function(e){this.q.body=e}},{key:"fields",value:function(e){this.q.fields=e}},{key:"filter",value:function(e){this.q.filter=e}},{key:"fieldBoosts",value:function(e){this.q.field_boosts=e}},{key:"instanceBoosts",value:function(e){this.q.instance_boosts=e}},{key:"aggregates",value:function(e){for(var t={},n=0;n<e.length;n++)t[e[n][0]]=e[n][1];this.q.aggregates=t}},{key:"sort",value:function(e){this.q.sort=e}},{key:"transforms",value:function(e){this.q.transforms=e}},{key:"tracking",value:function(e,t,n){this.type=e,this.field=t}},{key:"posNeg",value:function(e){this.generate_tokens="POS_NEG",this.token_key_field=e}},{key:"click",value:function(e){this.generate_tokens="CLICK",this.token_key_field=e}},{key:"data",value:function(e,t){this.d[e]=t}}]),e}());t.Query=L},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(){var e="",t=u["default"].get("_ga");if(void 0!==t){var n=t.split(".");n.length>2&&(e=n[2])}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.getGAID=r;var o=n(2),u=i(o)},function(e,t,n){var i,r;!function(o){var u=!1;if(i=o,r="function"==typeof i?i.call(t,n,t,e):i,!(void 0!==r&&(e.exports=r)),u=!0,e.exports=o(),u=!0,!u){var s=window.Cookies,a=window.Cookies=o();a.noConflict=function(){return window.Cookies=s,a}}}(function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function t(n){function i(t,r,o){var u;if("undefined"!=typeof document){if(arguments.length>1){if(o=e({path:"/"},i.defaults,o),"number"==typeof o.expires){var s=new Date;s.setMilliseconds(s.getMilliseconds()+864e5*o.expires),o.expires=s}try{u=JSON.stringify(r),/^[\{\[]/.test(u)&&(r=u)}catch(a){}return r=n.write?n.write(r,t):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape),document.cookie=[t,"=",r,o.expires?"; expires="+o.expires.toUTCString():"",o.path?"; path="+o.path:"",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("")}t||(u={});for(var c=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,_=0;_<c.length;_++){var f=c[_].split("="),E=f.slice(1).join("=");'"'===E.charAt(0)&&(E=E.slice(1,-1));try{var d=f[0].replace(l,decodeURIComponent);if(E=n.read?n.read(E,d):n(E,d)||E.replace(l,decodeURIComponent),this.json)try{E=JSON.parse(E)}catch(a){}if(t===d){u=E;break}t||(u[d]=E)}catch(a){}}return u}}return i.set=i,i.get=function(e){return i.call(i,e)},i.getJSON=function(){return i.apply({json:!0},[].slice.call(arguments))},i.defaults={},i.remove=function(t,n){i(t,"",e(n,{expires:-1}))},i.withConverter=t,i}return t(function(){})})}]); |
@@ -130,4 +130,4 @@ import { getGAID } from './utils' | ||
export function scoreInstanceBoost(threshold) { | ||
return { score: { threshold } }; | ||
export function scoreInstanceBoost(threshold, min_count) { | ||
return { score: { threshold, min_count } }; | ||
} | ||
@@ -134,0 +134,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
28439
2