@lableb/javascript-sdk
Version:
Lableb cloud search client for javascript
16 lines (13 loc) • 22.4 kB
JavaScript
window;import*as e from"yup";import t from"axios";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function s(e,t){var s={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(s[i[n]]=e[i[n]])}return s}function i(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{a(i.next(e))}catch(e){r(e)}}function d(e){try{a(i.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,d)}a((i=i.apply(e,t||[])).next())}))}function n(e,t){if(!e)return;let s=Object.assign({},e);return Object.keys(s).forEach((e=>{t(s[e])||delete s[e]})),s}function r(e){return"number"==typeof e&&0==e?"0":e}function o(e){let t={};return Object.keys(e).forEach((s=>{const i=s,n=s.replace(/[A-Z]/g,(e=>`_${e.toLowerCase()}`));t[n]=e[i]})),t}function d(e){return void 0===e||("string"==typeof e||"number"==typeof e)&&("string"!=typeof e||0!=e.length)}function a(e){return void 0===e||"number"==typeof e&&Number.isInteger(e)}const u="Platform name is a required field",l="Index name is a required field",c="API Key is a required field",m="Indexing API Key is a required field",h="Please provide a valid IP Address",p="query is a required field",b="documents is a required field",f="documents field must have at least 1 items",y="document id is a required field",I="document id passed must be none empty string",g="user country should be a string of two letters(iso 3166)",v="URL is not valid",N='Please provide an integer value for "skip"',O='Please provide an integer value for "limit"',j="User id must be none empty string",x='Please provide an integer value for "item order"',q="Feedback documents array should contains at least one item",A="Feedback documents array is required",P="Source document id(which used to fetch the recommend results for) is required for the recommend feedback to complete",k="Source document id passed must be none empty string",K="Target document id(which the user clicks from within the recommend results displayed) is required for the recommend feedback to complete",H="Source document id passed must be none empty string",G="Target Id can't be equal to source id in recommend feedback request",C="Target title document can't be empty string",E="Source title document can't be empty string",$="Wrong http method",F="Body is not allowed for get & delete requests",T="Body is required",B="Session Id Generator must be of type function and returns a string value",L=e.object().shape({sessionId:e.string().optional(),userId:e.string().optional().test("test-id",j,d),userIp:e.string().optional().test("test-ip",h,(function(e){return!e||!e.length||/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e)})),userCountry:e.string().length(2,g).optional().uppercase(),sessionIdGenerator:e.mixed().test("test-type",B,(function(e){if(e){if("function"!=typeof e)return!1;if("string"!=typeof e())return!1}return!0}))}),_=L.concat(e.object().shape({APIKey:e.string().optional(),indexingAPIKey:e.string().optional(),platformName:e.string().optional(),indexName:e.string().optional(),searchHandler:e.string().optional(),autocompleteHandler:e.string().optional(),recommendHandler:e.string().optional()})),S=L.concat(e.object().shape({platformName:e.string().required(u),indexName:e.string().required(l),indexingAPIKey:e.string().optional(),APIKey:e.string().optional()})),w=L.concat(e.object().shape({query:e.string().required(p),url:e.string().url(v).optional(),itemId:e.string().optional().test("test-id",I,d),itemOrder:e.number().optional().test("is-integer",x,a)})),R=L.concat(e.object().shape({sourceId:e.string().required(P).test("test-id",k,d),sourceTitle:e.string().optional().min(1,E),sourceUrl:e.string().optional().url(v),targetId:e.string().required(K).test("test-id",H,d).test("test-equal-with-source-id",G,(function(e,t){return t.parent.sourceId!=t.parent.targetId})),targetTitle:e.string().optional().min(1,C),targetUrl:e.string().optional().url(v),itemOrder:e.number().optional().test("is-integer",x,a)})),D=S.concat(e.object().shape({autocompleteHandler:e.string().optional(),APIKey:e.string().required(c),documentsFeedbacks:e.array().required(A).min(1,q).of(w)}));function U(e){return i(this,void 0,void 0,(function*(){const{documentFeedback:t}=e,i=s(e,["documentFeedback"]),n=Object.assign({},i);return t&&(n.documentsFeedbacks=[t]),M.bind(this)(n)}))}function M(e){var t;return i(this,void 0,void 0,(function*(){const s=yield D.validate(n(Object.assign(Object.assign({},e),{indexName:e.indexName||(null==this?void 0:this.indexName)||"index",platformName:e.platformName||(null==this?void 0:this.platformName),autocompleteHandler:e.autocompleteHandler||(null==this?void 0:this.autocompleteHandler)||"suggest",APIKey:e.APIKey||(null==this?void 0:this.APIKey),documentsFeedbacks:null===(t=e.documentsFeedbacks)||void 0===t?void 0:t.map((e=>n(Object.assign(Object.assign({},e),{userCountry:e.userCountry||(null==this?void 0:this.userCountry),userId:e.userId||(null==this?void 0:this.userId),userIp:e.userIp||(null==this?void 0:this.userIp),sessionId:e.sessionId||(null==this?void 0:this.sessionId)||(this.sessionIdGenerator?this.sessionIdGenerator():void 0)}),r)))}),r)),{indexName:i,platformName:o,autocompleteHandler:d,APIKey:a,documentsFeedbacks:u}=s;return{method:"POST",url:`https://api.lableb.com/v2/projects/${o}/indices/${i}/autocomplete/${d}/feedback/hits`,params:{apikey:a},headers:{},body:u}}))}const J=S.concat(e.object().shape({APIKey:e.string().required(c),query:e.string().required(p),autocompleteHandler:e.string().optional(),sort:e.string().optional(),limit:e.number().optional().test("test-integer",O,a)}));function V(e){return i(this,void 0,void 0,(function*(){const t=yield J.validate(n(Object.assign(Object.assign({},e),{indexName:e.indexName||(null==this?void 0:this.indexName)||"index",platformName:e.platformName||(null==this?void 0:this.platformName),autocompleteHandler:e.autocompleteHandler||(null==this?void 0:this.autocompleteHandler)||"suggest",APIKey:e.APIKey||(null==this?void 0:this.APIKey),userCountry:e.userCountry||(null==this?void 0:this.userCountry),userId:e.userId||(null==this?void 0:this.userId),userIp:e.userIp||(null==this?void 0:this.userIp),sessionId:e.sessionId||(null==this?void 0:this.sessionId),sessionIdGenerator:e.sessionIdGenerator||(null==this?void 0:this.sessionIdGenerator)}),r)),{indexName:i,platformName:o,autocompleteHandler:d,APIKey:a,query:u}=t,l=s(t,["indexName","platformName","autocompleteHandler","APIKey","query"]);return{method:"GET",url:`https://api.lableb.com/v2/projects/${o}/indices/${i}/autocomplete/${d}`,params:Object.assign({apikey:a,q:u},l),headers:{}}}))}const W=e.object().shape({indexingAPIKey:e.string().required(m),platformName:e.string().required(u),indexName:e.string().required(l),documentId:e.string().required(y).test("test-id",I,d)});function X(e){return i(this,void 0,void 0,(function*(){const t=yield W.validate(n({indexName:e.indexName||(null==this?void 0:this.indexName)||"index",platformName:e.platformName||(null==this?void 0:this.platformName),indexingAPIKey:e.indexingAPIKey||(null==this?void 0:this.indexingAPIKey),documentId:e.documentId},r)),{indexName:s,platformName:i,indexingAPIKey:o,documentId:d}=t;return{method:"DELETE",url:`https://api.lableb.com/v2/projects/${i}/indices/${s}/documents/${d}`,params:{apikey:o},headers:{}}}))}const Z=e.object().shape({indexingAPIKey:e.string().required(m),platformName:e.string().required(u),indexName:e.string().required(l),documents:e.array().required(b).min(1,f).of(e.object().shape({id:e.string().required(y).test("test-id",I,d)}))});function z(e){return i(this,void 0,void 0,(function*(){const t=yield Z.validate(n({indexName:e.indexName||(null==this?void 0:this.indexName)||"index",platformName:e.platformName||(null==this?void 0:this.platformName),indexingAPIKey:e.indexingAPIKey||(null==this?void 0:this.indexingAPIKey),documents:e.documents},r)),{indexName:s,platformName:i,indexingAPIKey:o,documents:d}=t;return{method:"POST",url:`https://api.lableb.com/v2/projects/${i}/indices/${s}/documents`,params:n({apikey:o},r),headers:{},body:d}}))}const Q=S.concat(e.object().shape({recommendHandler:e.string().optional(),APIKey:e.string().required(c),documentsFeedbacks:e.array().required(A).min(1,q).of(R)}));function Y(e){return i(this,void 0,void 0,(function*(){const{documentFeedback:t}=e,i=s(e,["documentFeedback"]),n=Object.assign({},i);return t&&(n.documentsFeedbacks=[t]),ee.bind(this)(n)}))}function ee(e){var t;return i(this,void 0,void 0,(function*(){const s=yield Q.validate(n(Object.assign(Object.assign({},e),{indexName:e.indexName||(null==this?void 0:this.indexName)||"index",platformName:e.platformName||(null==this?void 0:this.platformName),recommendHandler:e.recommendHandler||(null==this?void 0:this.recommendHandler)||"recommend",APIKey:e.APIKey||(null==this?void 0:this.APIKey),documentsFeedbacks:null===(t=e.documentsFeedbacks)||void 0===t?void 0:t.map((e=>n(Object.assign(Object.assign({},e),{userCountry:e.userCountry||(null==this?void 0:this.userCountry),userId:e.userId||(null==this?void 0:this.userId),userIp:e.userIp||(null==this?void 0:this.userIp),sessionId:e.sessionId||(null==this?void 0:this.sessionId)||(this.sessionIdGenerator?this.sessionIdGenerator():void 0)}),r)))}),r)),{indexName:i,platformName:o,recommendHandler:d,APIKey:a,documentsFeedbacks:u}=s;return{method:"POST",url:`https://api.lableb.com/v2/projects/${o}/indices/${i}/recommend/${d}/feedback/hits`,params:{apikey:a},headers:{},body:u}}))}const te=S.concat(e.object().shape({APIKey:e.string().required(c),id:e.string().test("test-id",I,d).required(y),title:e.string().optional(),url:e.string().url(v).optional(),recommendHandler:e.string().optional(),sort:e.string().optional(),limit:e.number().optional().test("test-integer",O,a)}));function se(e){return i(this,void 0,void 0,(function*(){const t=yield te.validate(n(Object.assign(Object.assign({},e),{indexName:e.indexName||(null==this?void 0:this.indexName)||"index",platformName:e.platformName||(null==this?void 0:this.platformName),recommendHandler:e.recommendHandler||(null==this?void 0:this.recommendHandler)||"recommend",APIKey:e.APIKey||(null==this?void 0:this.APIKey),userCountry:e.userCountry||(null==this?void 0:this.userCountry),userId:e.userId||(null==this?void 0:this.userId),userIp:e.userIp||(null==this?void 0:this.userIp),sessionId:e.sessionId||(null==this?void 0:this.sessionId)}),r)),{indexName:i,platformName:o,recommendHandler:d,APIKey:a}=t,u=s(t,["indexName","platformName","recommendHandler","APIKey"]);return{method:"GET",url:`https://api.lableb.com/v2/projects/${o}/indices/${i}/recommend/${d}`,params:Object.assign({apikey:a},u),headers:{}}}))}const ie=S.concat(e.object().shape({APIKey:e.string().required(c),id:e.string().required(y)}));function ne(e){return i(this,void 0,void 0,(function*(){const t=yield ie.validate(n(Object.assign(Object.assign({},e),{indexName:e.indexName||(null==this?void 0:this.indexName)||"index",platformName:e.platformName||(null==this?void 0:this.platformName),APIKey:e.APIKey||(null==this?void 0:this.APIKey),userCountry:e.userCountry||(null==this?void 0:this.userCountry),userId:e.userId||(null==this?void 0:this.userId),userIp:e.userIp||(null==this?void 0:this.userIp),sessionId:e.sessionId||(null==this?void 0:this.sessionId),sessionIdGenerator:e.sessionIdGenerator||(null==this?void 0:this.sessionIdGenerator)}),r)),{indexName:i,platformName:o,APIKey:d,id:a}=t,u=s(t,["indexName","platformName","APIKey","id"]);return{method:"GET",url:`https://api.lableb.com/v2/projects/${o}/indices/${i}/documents/${a}`,params:Object.assign({apikey:d},u),headers:{}}}))}const re=S.concat(e.object().shape({searchHandler:e.string().optional(),APIKey:e.string().required(c),documentsFeedbacks:e.array().required(A).min(1,q).of(w)}));function oe(e){return i(this,void 0,void 0,(function*(){const{documentFeedback:t}=e,i=s(e,["documentFeedback"]),n=Object.assign({},i);return t&&(n.documentsFeedbacks=[t]),de.bind(this)(n)}))}function de(e){var t;return i(this,void 0,void 0,(function*(){const s=yield re.validate(n(Object.assign(Object.assign({},e),{indexName:e.indexName||(null==this?void 0:this.indexName)||"index",platformName:e.platformName||(null==this?void 0:this.platformName),searchHandler:e.searchHandler||(null==this?void 0:this.searchHandler)||"default",APIKey:e.APIKey||(null==this?void 0:this.APIKey),documentsFeedbacks:null===(t=e.documentsFeedbacks)||void 0===t?void 0:t.map((e=>n(Object.assign(Object.assign({},e),{userCountry:e.userCountry||(null==this?void 0:this.userCountry),userId:e.userId||(null==this?void 0:this.userId),userIp:e.userIp||(null==this?void 0:this.userIp),sessionId:e.sessionId||(null==this?void 0:this.sessionId)||(this.sessionIdGenerator?this.sessionIdGenerator():void 0)}),r)))}),r)),{indexName:i,platformName:o,searchHandler:d,APIKey:a,documentsFeedbacks:u}=s;return{method:"POST",url:`https://api.lableb.com/v2/projects/${o}/indices/${i}/search/${d}/feedback/hits`,params:{apikey:a},headers:{},body:u}}))}const ae=S.concat(e.object().shape({APIKey:e.string().required(c),query:e.string().required(p),searchHandler:e.string().optional(),sort:e.string().optional(),skip:e.number().optional().test("test-integer",N,a),limit:e.number().optional().test("test-integer",O,a),facets:e.object().shape({key:e.string().optional()}).optional()}));function ue(e){return i(this,void 0,void 0,(function*(){const t=yield ae.validate(n(Object.assign(Object.assign({},e),{indexName:e.indexName||(null==this?void 0:this.indexName)||"index",platformName:e.platformName||(null==this?void 0:this.platformName),searchHandler:e.searchHandler||(null==this?void 0:this.searchHandler)||"default",APIKey:e.APIKey||(null==this?void 0:this.APIKey),userCountry:e.userCountry||(null==this?void 0:this.userCountry),userId:e.userId||(null==this?void 0:this.userId),userIp:e.userIp||(null==this?void 0:this.userIp),sessionId:e.sessionId||(null==this?void 0:this.sessionId),sessionIdGenerator:e.sessionIdGenerator||(null==this?void 0:this.sessionIdGenerator)}),r)),{indexName:i,platformName:o,searchHandler:d,APIKey:a,query:u,facets:l}=t,c=s(t,["indexName","platformName","searchHandler","APIKey","query","facets"]);let m="";if(e.facets){const t=function(e){const t=n(e,(e=>e&&e.length&&e.filter(r).length>0));let s="";for(const i of Object.keys(t))for(const t of e[i])s+=`${i}=${t}&`;return s.slice(0,s.length-1)}(e.facets);m=t?`?${t}`:""}return{method:"GET",url:`https://api.lableb.com/v2/projects/${o}/indices/${i}/search/${d}${m}`,params:Object.assign({apikey:a,q:u},c),headers:{}}}))}function le(e={}){return _.validateSync(n(e,r)),{index:z.bind(e),search:ue.bind(e),searchById:ne.bind(e),autocomplete:V.bind(e),recommend:se.bind(e),delete:X.bind(e),feedback:{search:{single:oe.bind(e),batch:de.bind(e)},autocomplete:{single:U.bind(e),batch:M.bind(e)},recommend:{single:Y.bind(e),batch:ee.bind(e)}}}}const ce=e.object().shape({method:e.string().required().test("test-http-method",$,(function(e){return!(e&&!["GET","POST","PUT","DELETE"].includes(e))})),url:e.string().required(),body:e.mixed().when("method",{is:e=>"GET"==e||"DELETE"==e,then:e.mixed().test("test-not-required",F,(e=>!e)),otherwise:e.mixed().required(T)}),params:e.object().optional(),headers:e.object().optional()});function me(e){return i(this,void 0,void 0,(function*(){const s=yield ce.validate(e);return t(n({method:null==s?void 0:s.method,url:null==s?void 0:s.url,headers:null==s?void 0:s.headers,data:null==s?void 0:s.body,params:null==s?void 0:s.params},r)).then((e=>e.data))}))}function he(e){return i(this,void 0,void 0,(function*(){const{url:t,headers:s,method:i,params:n,body:r}=yield this.requestBuilder.feedback.autocomplete.single(e),d={method:i,url:t,headers:s,params:o(n),body:r.map(o)};return yield me(d)}))}function pe(e){return i(this,void 0,void 0,(function*(){const{url:t,headers:s,method:i,params:n,body:r}=yield this.requestBuilder.feedback.autocomplete.batch(e),d={method:i,url:t,headers:s,params:o(n),body:r.map(o)};return yield me(d)}))}function be(e){return i(this,void 0,void 0,(function*(){return function({autocompleteOptions:e,globalOptions:t,autocompleteResponse:s}){return Object.assign(Object.assign({},s),{response:Object.assign(Object.assign({},s.response),{results:s.response.results.map(((s,i)=>Object.assign(Object.assign({},s),{feedback:n({query:e.query,itemId:s.id,itemOrder:i,url:s.url,userCountry:e.userCountry||t.userCountry,userId:e.userId||t.userId,userIp:e.userIp||t.userIp,sessionId:e.sessionId||(e.sessionIdGenerator?e.sessionIdGenerator():void 0)||t.sessionId||(t.sessionIdGenerator?t.sessionIdGenerator():void 0)},r)})))})})}({autocompleteOptions:e,autocompleteResponse:yield fe.bind(this)(e),globalOptions:this.globalOptions})}))}function fe(e){return i(this,void 0,void 0,(function*(){const{url:t,headers:s,method:i,params:n}=yield this.requestBuilder.autocomplete(e),r={method:i,url:t,headers:s,params:o(n)};return yield me(r)}))}function ye(e){return i(this,void 0,void 0,(function*(){const{url:t,headers:s,method:i,params:n}=yield this.requestBuilder.delete(e),r={method:i,url:t,headers:s,params:o(n)};return yield me(r)}))}function Ie(e){return i(this,void 0,void 0,(function*(){const{url:t,headers:s,method:i,params:n,body:r}=yield this.requestBuilder.index(e),d={method:i,url:t,headers:s,params:o(n),body:r};return yield me(d)}))}function ge(e){return i(this,void 0,void 0,(function*(){const{url:t,headers:s,method:i,params:n,body:r}=yield this.requestBuilder.feedback.recommend.single(e),d={method:i,url:t,headers:s,params:o(n),body:r.map(o)};return yield me(d)}))}function ve(e){return i(this,void 0,void 0,(function*(){const{url:t,headers:s,method:i,params:n,body:r}=yield this.requestBuilder.feedback.recommend.batch(e),d={method:i,url:t,headers:s,params:o(n),body:r.map(o)};return yield me(d)}))}function Ne(e){return i(this,void 0,void 0,(function*(){return function({globalOptions:e,recommendOptions:t,recommendResponse:s}){return Object.assign(Object.assign({},s),{response:Object.assign(Object.assign({},s.response),{results:s.response.results.map(((s,i)=>Object.assign(Object.assign({},s),{feedback:n({sourceId:t.id,targetId:s.id,sourceTitle:t.title,targetTitle:s.title,sourceUrl:t.url,targetUrl:s.url,itemOrder:i,userCountry:t.userCountry||e.userCountry,userId:t.userId||e.userId,userIp:t.userIp||e.userIp,sessionId:t.sessionId||(t.sessionIdGenerator?t.sessionIdGenerator():void 0)||e.sessionId||(e.sessionIdGenerator?e.sessionIdGenerator():void 0)},r)})))})})}({recommendOptions:e,recommendResponse:yield Oe.bind(this)(e),globalOptions:this.globalOptions})}))}function Oe(e){return i(this,void 0,void 0,(function*(){const{url:t,headers:s,method:i,params:n}=yield this.requestBuilder.recommend(e),r={method:i,url:t,headers:s,params:o(n)};return yield me(r)}))}function je(e){return i(this,void 0,void 0,(function*(){return yield xe.bind(this)(e)}))}function xe(e){return i(this,void 0,void 0,(function*(){const{url:t,headers:s,method:i,params:n}=yield this.requestBuilder.searchById(e),r={method:i,url:t,headers:s,params:o(n)};return yield me(r)}))}function qe(e){return i(this,void 0,void 0,(function*(){const{url:t,headers:s,method:i,params:n,body:r}=yield this.requestBuilder.feedback.search.single(e),d={method:i,url:t,headers:s,params:o(n),body:r.map(o)};return yield me(d)}))}function Ae(e){return i(this,void 0,void 0,(function*(){const{url:t,headers:s,method:i,params:n,body:r}=yield this.requestBuilder.feedback.search.batch(e),d={method:i,url:t,headers:s,params:o(n),body:r.map(o)};return yield me(d)}))}function Pe(e){return i(this,void 0,void 0,(function*(){return function({globalOptions:e,searchOptions:t,searchResponse:s}){return Object.assign(Object.assign({},s),{response:Object.assign(Object.assign({},s.response),{results:s.response.results.map(((s,i)=>Object.assign(Object.assign({},s),{feedback:n({query:t.query,itemId:s.id,itemOrder:i,url:s.url,userCountry:t.userCountry||e.userCountry,userId:t.userId||e.userId,userIp:t.userIp||e.userIp,sessionId:t.sessionId||(t.sessionIdGenerator?t.sessionIdGenerator():void 0)||e.sessionId||(e.sessionIdGenerator?e.sessionIdGenerator():void 0)},r)})))})})}({searchOptions:e,searchResponse:yield ke.bind(this)(e),globalOptions:this.globalOptions})}))}function ke(e){return i(this,void 0,void 0,(function*(){const{url:t,headers:s,method:i,params:n}=yield this.requestBuilder.search(e),r={method:i,url:t,headers:s,params:o(n)};return yield me(r)}))}function Ke(e={}){const{interceptors:i}=e,n=s(e,["interceptors"]);if(i)for(let{request:e,response:s}of i)t.interceptors.request.use(e.onFulfilled,e.onRejected,e.options),t.interceptors.response.use(s.onFulfilled,s.onRejected,s.options);const r={requestBuilder:le(n),globalOptions:n};return{index:Ie.bind(r),delete:ye.bind(r),search:Pe.bind(r),searchById:je.bind(r),autocomplete:be.bind(r),recommend:Ne.bind(r),feedback:{search:{single:qe.bind(r),batch:Ae.bind(r)},autocomplete:{single:he.bind(r),batch:pe.bind(r)},recommend:{single:ge.bind(r),batch:ve.bind(r)}},__defaults__:{API_BASE_URL:"https://api.lableb.com/v2",GLOBAL_DEFAULT_INDEX_NAME:"index",GLOBAL_DEFAULT_SEARCH_HANDLER:"default",GLOBAL_DEFAULT_AUTOCOMPLETE_HANDLER:"suggest",GLOBAL_DEFAULT_RECOMMEND_HANDLER:"recommend"}}}console.log("Lableb JS-SDK VERSION 2.1.4");export{Ke as LablebClient,le as LablebRequestBuilder,Ke as default};