Socket
Socket
Sign inDemoInstall

@elastic/app-search-javascript

Package Overview
Dependencies
1
Maintainers
68
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.4.1 to 8.5.1

2

dist/elastic_app_search.es.js

@@ -272,3 +272,3 @@ var classCallCheck = function (instance, Constructor) {

var version = "8.4.1";
var version = "8.5.1";

@@ -275,0 +275,0 @@ var QueryCache = function () {

@@ -278,3 +278,3 @@ (function (global, factory) {

var version = "8.4.1";
var version = "8.5.1";

@@ -281,0 +281,0 @@ var QueryCache = function () {

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.ElasticAppSearch={})}(this,function(e){"use strict";var s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e};function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=function(e,t){var n,r={};for(n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},f=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=(t(n,[{key:"getRaw",value:function(e){return(this.data[e]||{}).raw}},{key:"getSnippet",value:function(e){return(this.data[e]||{}).snippet}}]),n);function n(e){s(this,n),e._group&&0<e._group.length&&(e=l({},e,{_group:e._group.map(function(e){return new n(e)})})),this.data=e}function o(e,t){s(this,o),this.rawResults=e,this.rawInfo=t;var n=new Array;e.forEach(function(e){n.push(new a(e))}),this.results=n,this.info=t}var d=(t(c,[{key:"removeFilter",value:function(e){return new c(function r(i,e){e=Object.entries(e).reduce(function(e,t){var t=(n=f(t,2))[0],n=n[1];return t===i?e:(["all","any","none"].includes(t)&&(n=n.reduce(function(e,t){return(t=r(i,t))?e.concat(t):e},[])),l({},e,u({},t,n)))},{});if(0!==Object.keys(e).length)return e}(e,1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.filtersJSON))}},{key:"getListOfAppliedFilters",value:function(){var r=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.filtersJSON,e=Object.entries(e).reduce(function(n,e){var t=f(e,2),e=t[0],t=t[1];return["all","any","none"].includes(e)?t.forEach(function(t){Object.keys(t).forEach(function(e){["all","any","none"].includes(e)?n=new Set([].concat(h(n),h(r.getListOfAppliedFilters(t)))):n.add(e)})}):n.add(e),n},new Set);return Array.from(e.values())}}]),c);function c(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};s(this,c),this.filtersJSON=e}var p="8.4.1";function y(){s(this,y),this.cache={}}var v=new(t(y,[{key:"getKey",value:function(e,t,n){return e+t+JSON.stringify(n)}},{key:"store",value:function(e,t){this.cache[e]=t}},{key:"retrieve",value:function(e){return this.cache[e]}}]),y);function g(e,t,n,r,i,a){var s=(5<arguments.length&&void 0!==a?a:{}).additionalHeaders,o=v.getKey("POST",t+n,r);if(i){a=v.retrieve(o);if(a)return Promise.resolve(a)}return function(e,t,n,r,i){var a=(5<arguments.length&&void 0!==arguments[5]?arguments[5]:{}).additionalHeaders,s="undefined"!=typeof window?"browser":process.version,a=new Headers(l({},t&&{Authorization:"Bearer "+t},{"Content-Type":"application/json","X-Swiftype-Client":"elastic-app-search-javascript","X-Swiftype-Client-Version":p,"x-elastic-client-meta":"ent="+p+"-legacy,js="+s+",t="+p+"-legacy,ft=universal"},a));return fetch(""+n+r,{method:e,headers:a,body:JSON.stringify(i),credentials:"include"})}("POST",e,t,n,r,{additionalHeaders:s}).then(function(t){return t.json().then(function(e){e={response:t,json:e};return i&&v.store(o,e),e}).catch(function(){return{response:t,json:{}}})})}var m="SEARCH",w="MULTI_SEARCH";function j(e){return new o(e.results,function(e,t){if(e){e[t];return i(e,[t])}}(e,"results"))}function S(e){var t=e.response,n=e.json;if(t.ok)return n;n=Array.isArray(n)?" "+(e=n.map(function(e){return e.errors}),[].concat.apply([],e).join(", ")):n.errors?" "+n.errors:"";throw new Error("["+t.status+"]"+n)}var O=(t(b,[{key:"querySuggestion",value:function(e){e=Object.assign({query:e},1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});return g(this.searchKey,this.apiEndpoint,this.querySuggestionPath,e,this.cacheResponses,{additionalHeaders:this.additionalHeaders}).then(S)}},{key:"search",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=t.disjunctiveFacets,r=t.disjunctiveFacetsAnalyticsTags,t=i(t,["disjunctiveFacets","disjunctiveFacetsAnalyticsTags"]),t=Object.assign({query:e},t);return(n&&0<n.length?this._performDisjunctiveSearch(t,n,r):this._performSearch(t)).then(j)}},{key:"multiSearch",value:function(e){e=e.map(function(e){return l({query:e.query},e.options||{})});return this._performSearch({queries:e},w).then(function(e){return e.map(j)})}},{key:"_performDisjunctiveSearch",value:function(t,n){var r=this,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["Facet-Only"],i=this._performSearch(t),a=new d(t.filters),s=a.getListOfAppliedFilters().filter(function(e){return n.includes(e)});if(!s.length)return i;var o=t.page||{},c=t.analytics||{};c.tags=e;s=s.map(function(e){return r._performSearch(l({},t,{filters:a.removeFilter(e).filtersJSON,record_analytics:!1,page:l({},o,{size:0}),analytics:c,facets:u({},e,t.facets[e])}))});return Promise.all([i].concat(h(s))).then(function(e){var e=(e=e,Array.isArray(e)?e:Array.from(e)),n=e[0];return e.slice(1).forEach(function(e){var t=f(Object.entries(e.facets)[0],2),e=t[0],t=t[1];n.facets[e]=t}),n})}},{key:"_performSearch",value:function(e){var t=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:m)===w?this.multiSearchPath:this.searchPath;return g(this.searchKey,this.apiEndpoint,t+".json",e,this.cacheResponses,{additionalHeaders:this.additionalHeaders}).then(S)}},{key:"click",value:function(e){var t=e.query,n=e.documentId,r=e.requestId,e=e.tags;return g(this.searchKey,this.apiEndpoint,this.clickPath+".json",{query:t,document_id:n,request_id:r,tags:void 0===e?[]:e},this.cacheResponses,{additionalHeaders:this.additionalHeaders}).then(S)}}]),b);function b(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},i=r.endpointBase,a=void 0===i?"":i,i=r.cacheResponses,i=void 0===i||i,r=r.additionalHeaders;s(this,b),this.additionalHeaders=r,this.searchKey=t,this.cacheResponses=i,this.engineName=n,this.apiEndpoint=a?a+"/api/as/v1/":"https://"+e+".api.swiftype.com/api/as/v1/",this.searchPath="engines/"+this.engineName+"/search",this.multiSearchPath="engines/"+this.engineName+"/multi_search",this.querySuggestionPath="engines/"+this.engineName+"/query_suggestion",this.clickPath="engines/"+this.engineName+"/click"}e.createClient=function(e){var t=e.hostIdentifier,n=e.accountHostKey,r=e.apiKey,i=e.searchKey,a=e.engineName,s=e.endpointBase,o=e.cacheResponses,e=e.additionalHeaders;return new O(t=t||n,i=i||r,a,{endpointBase:s,cacheResponses:o,additionalHeaders:e})},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.ElasticAppSearch={})}(this,function(e){"use strict";var s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e};function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=function(e,t){var n,r={};for(n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},f=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=(t(n,[{key:"getRaw",value:function(e){return(this.data[e]||{}).raw}},{key:"getSnippet",value:function(e){return(this.data[e]||{}).snippet}}]),n);function n(e){s(this,n),e._group&&0<e._group.length&&(e=l({},e,{_group:e._group.map(function(e){return new n(e)})})),this.data=e}function o(e,t){s(this,o),this.rawResults=e,this.rawInfo=t;var n=new Array;e.forEach(function(e){n.push(new a(e))}),this.results=n,this.info=t}var d=(t(c,[{key:"removeFilter",value:function(e){return new c(function r(i,e){e=Object.entries(e).reduce(function(e,t){var t=(n=f(t,2))[0],n=n[1];return t===i?e:(["all","any","none"].includes(t)&&(n=n.reduce(function(e,t){return(t=r(i,t))?e.concat(t):e},[])),l({},e,u({},t,n)))},{});if(0!==Object.keys(e).length)return e}(e,1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.filtersJSON))}},{key:"getListOfAppliedFilters",value:function(){var r=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.filtersJSON,e=Object.entries(e).reduce(function(n,e){var t=f(e,2),e=t[0],t=t[1];return["all","any","none"].includes(e)?t.forEach(function(t){Object.keys(t).forEach(function(e){["all","any","none"].includes(e)?n=new Set([].concat(h(n),h(r.getListOfAppliedFilters(t)))):n.add(e)})}):n.add(e),n},new Set);return Array.from(e.values())}}]),c);function c(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};s(this,c),this.filtersJSON=e}var p="8.5.1";function y(){s(this,y),this.cache={}}var v=new(t(y,[{key:"getKey",value:function(e,t,n){return e+t+JSON.stringify(n)}},{key:"store",value:function(e,t){this.cache[e]=t}},{key:"retrieve",value:function(e){return this.cache[e]}}]),y);function g(e,t,n,r,i,a){var s=(5<arguments.length&&void 0!==a?a:{}).additionalHeaders,o=v.getKey("POST",t+n,r);if(i){a=v.retrieve(o);if(a)return Promise.resolve(a)}return function(e,t,n,r,i){var a=(5<arguments.length&&void 0!==arguments[5]?arguments[5]:{}).additionalHeaders,s="undefined"!=typeof window?"browser":process.version,a=new Headers(l({},t&&{Authorization:"Bearer "+t},{"Content-Type":"application/json","X-Swiftype-Client":"elastic-app-search-javascript","X-Swiftype-Client-Version":p,"x-elastic-client-meta":"ent="+p+"-legacy,js="+s+",t="+p+"-legacy,ft=universal"},a));return fetch(""+n+r,{method:e,headers:a,body:JSON.stringify(i),credentials:"include"})}("POST",e,t,n,r,{additionalHeaders:s}).then(function(t){return t.json().then(function(e){e={response:t,json:e};return i&&v.store(o,e),e}).catch(function(){return{response:t,json:{}}})})}var m="SEARCH",w="MULTI_SEARCH";function j(e){return new o(e.results,function(e,t){if(e){e[t];return i(e,[t])}}(e,"results"))}function S(e){var t=e.response,n=e.json;if(t.ok)return n;n=Array.isArray(n)?" "+(e=n.map(function(e){return e.errors}),[].concat.apply([],e).join(", ")):n.errors?" "+n.errors:"";throw new Error("["+t.status+"]"+n)}var O=(t(b,[{key:"querySuggestion",value:function(e){e=Object.assign({query:e},1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});return g(this.searchKey,this.apiEndpoint,this.querySuggestionPath,e,this.cacheResponses,{additionalHeaders:this.additionalHeaders}).then(S)}},{key:"search",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=t.disjunctiveFacets,r=t.disjunctiveFacetsAnalyticsTags,t=i(t,["disjunctiveFacets","disjunctiveFacetsAnalyticsTags"]),t=Object.assign({query:e},t);return(n&&0<n.length?this._performDisjunctiveSearch(t,n,r):this._performSearch(t)).then(j)}},{key:"multiSearch",value:function(e){e=e.map(function(e){return l({query:e.query},e.options||{})});return this._performSearch({queries:e},w).then(function(e){return e.map(j)})}},{key:"_performDisjunctiveSearch",value:function(t,n){var r=this,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["Facet-Only"],i=this._performSearch(t),a=new d(t.filters),s=a.getListOfAppliedFilters().filter(function(e){return n.includes(e)});if(!s.length)return i;var o=t.page||{},c=t.analytics||{};c.tags=e;s=s.map(function(e){return r._performSearch(l({},t,{filters:a.removeFilter(e).filtersJSON,record_analytics:!1,page:l({},o,{size:0}),analytics:c,facets:u({},e,t.facets[e])}))});return Promise.all([i].concat(h(s))).then(function(e){var e=(e=e,Array.isArray(e)?e:Array.from(e)),n=e[0];return e.slice(1).forEach(function(e){var t=f(Object.entries(e.facets)[0],2),e=t[0],t=t[1];n.facets[e]=t}),n})}},{key:"_performSearch",value:function(e){var t=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:m)===w?this.multiSearchPath:this.searchPath;return g(this.searchKey,this.apiEndpoint,t+".json",e,this.cacheResponses,{additionalHeaders:this.additionalHeaders}).then(S)}},{key:"click",value:function(e){var t=e.query,n=e.documentId,r=e.requestId,e=e.tags;return g(this.searchKey,this.apiEndpoint,this.clickPath+".json",{query:t,document_id:n,request_id:r,tags:void 0===e?[]:e},this.cacheResponses,{additionalHeaders:this.additionalHeaders}).then(S)}}]),b);function b(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},i=r.endpointBase,a=void 0===i?"":i,i=r.cacheResponses,i=void 0===i||i,r=r.additionalHeaders;s(this,b),this.additionalHeaders=r,this.searchKey=t,this.cacheResponses=i,this.engineName=n,this.apiEndpoint=a?a+"/api/as/v1/":"https://"+e+".api.swiftype.com/api/as/v1/",this.searchPath="engines/"+this.engineName+"/search",this.multiSearchPath="engines/"+this.engineName+"/multi_search",this.querySuggestionPath="engines/"+this.engineName+"/query_suggestion",this.clickPath="engines/"+this.engineName+"/click"}e.createClient=function(e){var t=e.hostIdentifier,n=e.accountHostKey,r=e.apiKey,i=e.searchKey,a=e.engineName,s=e.endpointBase,o=e.cacheResponses,e=e.additionalHeaders;return new O(t=t||n,i=i||r,a,{endpointBase:s,cacheResponses:o,additionalHeaders:e})},Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "@elastic/app-search-javascript",
"version": "8.4.1",
"version": "8.5.1",
"description": "Javascript client for the Elastic App Search Api",

@@ -5,0 +5,0 @@ "browser": "dist/elastic_app_search.umd.js",

@@ -28,3 +28,3 @@ <p align="center"><img src="https://github.com/elastic/app-search-javascript/blob/master/logo-app-search.png?raw=true" alt="Elastic App Search Logo"></p>

```html
<script src="https://cdn.jsdelivr.net/npm/@elastic/app-search-javascript@8.4.1/dist/elastic_app_search.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@elastic/app-search-javascript@8.5.1/dist/elastic_app_search.umd.js"></script>
```

@@ -31,0 +31,0 @@

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

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

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

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

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc