Socket
Socket
Sign inDemoInstall

meilisearch

Package Overview
Dependencies
Maintainers
4
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meilisearch - npm Package Compare versions

Comparing version 0.38.0 to 0.39.0

2

dist/bundles/meilisearch.esm.min.js

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

import t from"crypto";const e={ALL:"all",LAST:"last"},i={JSON:"application/json",CSV:"text/csv",NDJSON:"application/x-ndjson"},s={TASK_SUCCEEDED:"succeeded",TASK_PROCESSING:"processing",TASK_FAILED:"failed",TASK_ENQUEUED:"enqueued",TASK_CANCELED:"canceled"},n={DOCUMENTS_ADDITION_OR_UPDATE:"documentAdditionOrUpdate",DOCUMENT_DELETION:"documentDeletion",DUMP_CREATION:"dumpCreation",INDEX_CREATION:"indexCreation",INDEX_DELETION:"indexDeletion",INDEXES_SWAP:"indexSwap",INDEX_UPDATE:"indexUpdate",SETTINGS_UPDATE:"settingsUpdate",SNAPSHOT_CREATION:"snapshotCreation",TASK_CANCELATION:"taskCancelation",TASK_DELETION:"taskDeletion"},r={INDEX_CREATION_FAILED:"index_creation_failed",MISSING_INDEX_UID:"missing_index_uid",INDEX_ALREADY_EXISTS:"index_already_exists",INDEX_NOT_FOUND:"index_not_found",INVALID_INDEX_UID:"invalid_index_uid",INDEX_NOT_ACCESSIBLE:"index_not_accessible",INVALID_INDEX_OFFSET:"invalid_index_offset",INVALID_INDEX_LIMIT:"invalid_index_limit",INVALID_STATE:"invalid_state",PRIMARY_KEY_INFERENCE_FAILED:"primary_key_inference_failed",INDEX_PRIMARY_KEY_ALREADY_EXISTS:"index_primary_key_already_exists",INVALID_INDEX_PRIMARY_KEY:"invalid_index_primary_key",DOCUMENTS_FIELDS_LIMIT_REACHED:"document_fields_limit_reached",MISSING_DOCUMENT_ID:"missing_document_id",INVALID_DOCUMENT_ID:"invalid_document_id",INVALID_CONTENT_TYPE:"invalid_content_type",MISSING_CONTENT_TYPE:"missing_content_type",INVALID_DOCUMENT_FIELDS:"invalid_document_fields",INVALID_DOCUMENT_LIMIT:"invalid_document_limit",INVALID_DOCUMENT_OFFSET:"invalid_document_offset",INVALID_DOCUMENT_FILTER:"invalid_document_filter",MISSING_DOCUMENT_FILTER:"missing_document_filter",INVALID_DOCUMENT_VECTORS_FIELD:"invalid_document_vectors_field",PAYLOAD_TOO_LARGE:"payload_too_large",MISSING_PAYLOAD:"missing_payload",MALFORMED_PAYLOAD:"malformed_payload",NO_SPACE_LEFT_ON_DEVICE:"no_space_left_on_device",INVALID_STORE_FILE:"invalid_store_file",INVALID_RANKING_RULES:"missing_document_id",INVALID_REQUEST:"invalid_request",INVALID_DOCUMENT_GEO_FIELD:"invalid_document_geo_field",INVALID_SEARCH_Q:"invalid_search_q",INVALID_SEARCH_OFFSET:"invalid_search_offset",INVALID_SEARCH_LIMIT:"invalid_search_limit",INVALID_SEARCH_PAGE:"invalid_search_page",INVALID_SEARCH_HITS_PER_PAGE:"invalid_search_hits_per_page",INVALID_SEARCH_ATTRIBUTES_TO_RETRIEVE:"invalid_search_attributes_to_retrieve",INVALID_SEARCH_ATTRIBUTES_TO_CROP:"invalid_search_attributes_to_crop",INVALID_SEARCH_CROP_LENGTH:"invalid_search_crop_length",INVALID_SEARCH_ATTRIBUTES_TO_HIGHLIGHT:"invalid_search_attributes_to_highlight",INVALID_SEARCH_SHOW_MATCHES_POSITION:"invalid_search_show_matches_position",INVALID_SEARCH_FILTER:"invalid_search_filter",INVALID_SEARCH_SORT:"invalid_search_sort",INVALID_SEARCH_FACETS:"invalid_search_facets",INVALID_SEARCH_HIGHLIGHT_PRE_TAG:"invalid_search_highlight_pre_tag",INVALID_SEARCH_HIGHLIGHT_POST_TAG:"invalid_search_highlight_post_tag",INVALID_SEARCH_CROP_MARKER:"invalid_search_crop_marker",INVALID_SEARCH_MATCHING_STRATEGY:"invalid_search_matching_strategy",INVALID_SEARCH_VECTOR:"invalid_search_vector",INVALID_SEARCH_ATTRIBUTES_TO_SEARCH_ON:"invalid_search_attributes_to_search_on",BAD_REQUEST:"bad_request",DOCUMENT_NOT_FOUND:"document_not_found",INTERNAL:"internal",INVALID_API_KEY:"invalid_api_key",INVALID_API_KEY_DESCRIPTION:"invalid_api_key_description",INVALID_API_KEY_ACTIONS:"invalid_api_key_actions",INVALID_API_KEY_INDEXES:"invalid_api_key_indexes",INVALID_API_KEY_EXPIRES_AT:"invalid_api_key_expires_at",API_KEY_NOT_FOUND:"api_key_not_found",IMMUTABLE_API_KEY_UID:"immutable_api_key_uid",IMMUTABLE_API_KEY_ACTIONS:"immutable_api_key_actions",IMMUTABLE_API_KEY_INDEXES:"immutable_api_key_indexes",IMMUTABLE_API_KEY_EXPIRES_AT:"immutable_api_key_expires_at",IMMUTABLE_API_KEY_CREATED_AT:"immutable_api_key_created_at",IMMUTABLE_API_KEY_UPDATED_AT:"immutable_api_key_updated_at",MISSING_AUTHORIZATION_HEADER:"missing_authorization_header",UNRETRIEVABLE_DOCUMENT:"unretrievable_document",MAX_DATABASE_SIZE_LIMIT_REACHED:"database_size_limit_reached",TASK_NOT_FOUND:"task_not_found",DUMP_PROCESS_FAILED:"dump_process_failed",DUMP_NOT_FOUND:"dump_not_found",INVALID_SWAP_DUPLICATE_INDEX_FOUND:"invalid_swap_duplicate_index_found",INVALID_SWAP_INDEXES:"invalid_swap_indexes",MISSING_SWAP_INDEXES:"missing_swap_indexes",MISSING_MASTER_KEY:"missing_master_key",INVALID_TASK_TYPES:"invalid_task_types",INVALID_TASK_UIDS:"invalid_task_uids",INVALID_TASK_STATUSES:"invalid_task_statuses",INVALID_TASK_LIMIT:"invalid_task_limit",INVALID_TASK_FROM:"invalid_task_from",INVALID_TASK_CANCELED_BY:"invalid_task_canceled_by",MISSING_TASK_FILTERS:"missing_task_filters",TOO_MANY_OPEN_FILES:"too_many_open_files",IO_ERROR:"io_error",INVALID_TASK_INDEX_UIDS:"invalid_task_index_uids",IMMUTABLE_INDEX_UID:"immutable_index_uid",IMMUTABLE_INDEX_CREATED_AT:"immutable_index_created_at",IMMUTABLE_INDEX_UPDATED_AT:"immutable_index_updated_at",INVALID_SETTINGS_DISPLAYED_ATTRIBUTES:"invalid_settings_displayed_attributes",INVALID_SETTINGS_SEARCHABLE_ATTRIBUTES:"invalid_settings_searchable_attributes",INVALID_SETTINGS_FILTERABLE_ATTRIBUTES:"invalid_settings_filterable_attributes",INVALID_SETTINGS_SORTABLE_ATTRIBUTES:"invalid_settings_sortable_attributes",INVALID_SETTINGS_RANKING_RULES:"invalid_settings_ranking_rules",INVALID_SETTINGS_STOP_WORDS:"invalid_settings_stop_words",INVALID_SETTINGS_SYNONYMS:"invalid_settings_synonyms",INVALID_SETTINGS_DISTINCT_ATTRIBUTE:"invalid_settings_distinct_attribute",INVALID_SETTINGS_TYPO_TOLERANCE:"invalid_settings_typo_tolerance",INVALID_SETTINGS_FACETING:"invalid_settings_faceting",INVALID_SETTINGS_PAGINATION:"invalid_settings_pagination",INVALID_TASK_BEFORE_ENQUEUED_AT:"invalid_task_before_enqueued_at",INVALID_TASK_AFTER_ENQUEUED_AT:"invalid_task_after_enqueued_at",INVALID_TASK_BEFORE_STARTED_AT:"invalid_task_before_started_at",INVALID_TASK_AFTER_STARTED_AT:"invalid_task_after_started_at",INVALID_TASK_BEFORE_FINISHED_AT:"invalid_task_before_finished_at",INVALID_TASK_AFTER_FINISHED_AT:"invalid_task_after_finished_at",MISSING_API_KEY_ACTIONS:"missing_api_key_actions",MISSING_API_KEY_INDEXES:"missing_api_key_indexes",MISSING_API_KEY_EXPIRES_AT:"missing_api_key_expires_at",INVALID_API_KEY_LIMIT:"invalid_api_key_limit",INVALID_API_KEY_OFFSET:"invalid_api_key_offset",INVALID_FACET_SEARCH_FACET_NAME:"invalid_facet_search_facet_name",MISSING_FACET_SEARCH_FACET_NAME:"missing_facet_search_facet_name",INVALID_FACET_SEARCH_FACET_QUERY:"invalid_facet_search_facet_query"};function o(t,e,i,s){return new(i||(i=Promise))((function(n,r){function o(t){try{u(s.next(t))}catch(t){r(t)}}function d(t){try{u(s.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,d)}u((s=s.apply(t,e||[])).next())}))}class d extends Error{constructor(t){super(t),Object.setPrototypeOf(this,d.prototype),this.name="MeiliSearchError",Error.captureStackTrace&&Error.captureStackTrace(this,d)}}class u extends d{constructor(t,e,i,s){var n,r,o;super(t),Object.setPrototypeOf(this,u.prototype),this.name="MeiliSearchCommunicationError",e instanceof Response&&(this.message=e.statusText,this.statusCode=e.status),e instanceof Error&&(this.errno=e.errno,this.code=e.code),s?(this.stack=s,this.stack=null===(n=this.stack)||void 0===n?void 0:n.replace(/(TypeError|FetchError)/,this.name),this.stack=null===(r=this.stack)||void 0===r?void 0:r.replace("Failed to fetch",`request to ${i} failed, reason: connect ECONNREFUSED`),this.stack=null===(o=this.stack)||void 0===o?void 0:o.replace("Not Found",`Not Found: ${i}`)):Error.captureStackTrace&&Error.captureStackTrace(this,u)}}const a=class extends d{constructor(t,e){super(t.message),Object.setPrototypeOf(this,a.prototype),this.name="MeiliSearchApiError",this.code=t.code,this.type=t.type,this.link=t.link,this.message=t.message,this.httpStatus=e,Error.captureStackTrace&&Error.captureStackTrace(this,a)}};function h(t){return o(this,void 0,void 0,(function*(){if(!t.ok){let e;try{e=yield t.json()}catch(e){throw new u(t.statusText,t,t.url)}throw new a(e,t.status)}return t}))}function c(t,e,i){if("MeiliSearchApiError"!==t.name)throw new u(t.message,t,i,e);throw t}class _ extends d{constructor(t){super(t),Object.setPrototypeOf(this,_.prototype),this.name="MeiliSearchTimeOutError",Error.captureStackTrace&&Error.captureStackTrace(this,_)}}function l(t,e){return`${t}\nHint: It might not be working because maybe you're not up to date with the Meilisearch version that ${e} call requires.`}function v(t){return Object.entries(t).reduce(((t,e)=>{const[i,s]=e;return void 0!==s&&(t[i]=s),t}),{})}function p(t){return o(this,void 0,void 0,(function*(){return yield new Promise((e=>setTimeout(e,t)))}))}function A(t){return Object.keys(t).reduce(((e,i)=>{const s=t[i];return void 0===s?e:Array.isArray(s)?Object.assign(Object.assign({},e),{[i]:s.join(",")}):s instanceof Date?Object.assign(Object.assign({},e),{[i]:s.toISOString()}):Object.assign(Object.assign({},e),{[i]:s})}),{})}function I(t){var e,i;const s="X-Meilisearch-Client",n="Meilisearch JavaScript (v0.38.0)",r=function(t){if(Array.isArray(t))return t.reduce(((t,e)=>(t[e[0]]=e[1],t)),{});if("has"in t){const e={};return t.forEach(((t,i)=>e[i]=t)),e}return Object.assign({},t)}(null!==(i=null===(e=t.requestConfig)||void 0===e?void 0:e.headers)&&void 0!==i?i:{});if(t.apiKey&&!r.Authorization&&(r.Authorization=`Bearer ${t.apiKey}`),r["Content-Type"]||(r["Content-Type"]="application/json"),t.clientAgents&&Array.isArray(t.clientAgents)){const e=t.clientAgents.concat(n);r[s]=e.join(" ; ")}else{if(t.clientAgents&&!Array.isArray(t.clientAgents))throw new d(`Meilisearch: The header "${s}" should be an array of string(s).\n`);r[s]=n}return r}class f{constructor(t){this.headers=I(t),this.requestConfig=t.requestConfig,this.httpClient=t.httpClient,this.requestTimeout=t.timeout;try{const e=function(t){try{return(e=t=function(t){return t.startsWith("https://")||t.startsWith("http://")?t:`http://${t}`}(t)).endsWith("/")||(e+="/"),t=e}catch(t){throw new d("The provided host is not valid.")}var e}(t.host);this.url=new URL(e)}catch(t){throw new d("The provided host is not valid.")}}request({method:t,url:e,params:i,body:s,config:n={}}){var r;return o(this,void 0,void 0,(function*(){"undefined"==typeof fetch&&require("cross-fetch/polyfill");const o=new URL(e,this.url);if(i){const t=new URLSearchParams;Object.keys(i).filter((t=>null!==i[t])).map((e=>t.set(e,i[e]))),o.search=t.toString()}(null===(r=n.headers)||void 0===r?void 0:r["Content-Type"])||(s=JSON.stringify(s));const d=Object.assign(Object.assign({},this.headers),n.headers);try{const e=this.fetchWithTimeout(o.toString(),Object.assign(Object.assign(Object.assign({},n),this.requestConfig),{method:t,body:s,headers:d}),this.requestTimeout);if(this.httpClient)return yield e;const i=yield e.then((t=>h(t)));return yield i.json().catch((()=>{}))}catch(t){c(t,t.stack,o.toString())}}))}fetchWithTimeout(t,e,i){return o(this,void 0,void 0,(function*(){return new Promise(((s,n)=>{const r=[(this.httpClient?this.httpClient:fetch)(t,e)];let o;if(i){const t=new Promise(((t,e)=>{o=setTimeout((()=>{e(new Error("Error: Request Timed Out"))}),i)}));r.push(t)}Promise.race(r).then(s).catch(n).finally((()=>{clearTimeout(o)}))}))}))}get(t,e,i){return o(this,void 0,void 0,(function*(){return yield this.request({method:"GET",url:t,params:e,config:i})}))}post(t,e,i,s){return o(this,void 0,void 0,(function*(){return yield this.request({method:"POST",url:t,body:e,params:i,config:s})}))}put(t,e,i,s){return o(this,void 0,void 0,(function*(){return yield this.request({method:"PUT",url:t,body:e,params:i,config:s})}))}patch(t,e,i,s){return o(this,void 0,void 0,(function*(){return yield this.request({method:"PATCH",url:t,body:e,params:i,config:s})}))}delete(t,e,i,s){return o(this,void 0,void 0,(function*(){return yield this.request({method:"DELETE",url:t,body:e,params:i,config:s})}))}}class T{constructor(t){this.taskUid=t.taskUid,this.indexUid=t.indexUid,this.status=t.status,this.type=t.type,this.enqueuedAt=new Date(t.enqueuedAt)}}class y{constructor(t){this.indexUid=t.indexUid,this.status=t.status,this.type=t.type,this.uid=t.uid,this.details=t.details,this.canceledBy=t.canceledBy,this.error=t.error,this.duration=t.duration,this.startedAt=new Date(t.startedAt),this.enqueuedAt=new Date(t.enqueuedAt),this.finishedAt=new Date(t.finishedAt)}}class E{constructor(t){this.httpRequest=new f(t)}getTask(t){return o(this,void 0,void 0,(function*(){const e=`tasks/${t}`,i=yield this.httpRequest.get(e);return new y(i)}))}getTasks(t={}){return o(this,void 0,void 0,(function*(){const e=yield this.httpRequest.get("tasks",A(t));return Object.assign(Object.assign({},e),{results:e.results.map((t=>new y(t)))})}))}waitForTask(t,{timeOutMs:e=5e3,intervalMs:i=50}={}){return o(this,void 0,void 0,(function*(){const n=Date.now();for(;Date.now()-n<e;){const e=yield this.getTask(t);if(![s.TASK_ENQUEUED,s.TASK_PROCESSING].includes(e.status))return e;yield p(i)}throw new _(`timeout of ${e}ms has exceeded on process ${t} when waiting a task to be resolved.`)}))}waitForTasks(t,{timeOutMs:e=5e3,intervalMs:i=50}={}){return o(this,void 0,void 0,(function*(){const s=[];for(const n of t){const t=yield this.waitForTask(n,{timeOutMs:e,intervalMs:i});s.push(t)}return s}))}cancelTasks(t={}){return o(this,void 0,void 0,(function*(){const e=yield this.httpRequest.post("tasks/cancel",{},A(t));return new T(e)}))}deleteTasks(t={}){return o(this,void 0,void 0,(function*(){const e=yield this.httpRequest.delete("tasks",{},A(t));return new T(e)}))}}class g{constructor(t,e,i){this.uid=e,this.primaryKey=i,this.httpRequest=new f(t),this.tasks=new E(t)}search(t,e,i){return o(this,void 0,void 0,(function*(){const s=`indexes/${this.uid}/search`;return yield this.httpRequest.post(s,v(Object.assign({q:t},e)),void 0,i)}))}searchGet(t,e,i){var s,n,r,u,a,h,c;return o(this,void 0,void 0,(function*(){const o=`indexes/${this.uid}/search`,_=Object.assign(Object.assign({q:t},e),{filter:(t=>{if("string"==typeof t)return t;if(Array.isArray(t))throw new d("The filter query parameter should be in string format when using searchGet")})(null==e?void 0:e.filter),sort:null===(s=null==e?void 0:e.sort)||void 0===s?void 0:s.join(","),facets:null===(n=null==e?void 0:e.facets)||void 0===n?void 0:n.join(","),attributesToRetrieve:null===(r=null==e?void 0:e.attributesToRetrieve)||void 0===r?void 0:r.join(","),attributesToCrop:null===(u=null==e?void 0:e.attributesToCrop)||void 0===u?void 0:u.join(","),attributesToHighlight:null===(a=null==e?void 0:e.attributesToHighlight)||void 0===a?void 0:a.join(","),vector:null===(h=null==e?void 0:e.vector)||void 0===h?void 0:h.join(","),attributesToSearchOn:null===(c=null==e?void 0:e.attributesToSearchOn)||void 0===c?void 0:c.join(",")});return yield this.httpRequest.get(o,v(_),i)}))}searchForFacetValues(t,e){return o(this,void 0,void 0,(function*(){const i=`indexes/${this.uid}/facet-search`;return yield this.httpRequest.post(i,v(t),void 0,e)}))}getRawInfo(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}`,e=yield this.httpRequest.get(t);return this.primaryKey=e.primaryKey,this.updatedAt=new Date(e.updatedAt),this.createdAt=new Date(e.createdAt),e}))}fetchInfo(){return o(this,void 0,void 0,(function*(){return yield this.getRawInfo(),this}))}fetchPrimaryKey(){return o(this,void 0,void 0,(function*(){return this.primaryKey=(yield this.getRawInfo()).primaryKey,this.primaryKey}))}static create(t,e={},i){return o(this,void 0,void 0,(function*(){const s=new f(i),n=yield s.post("indexes",Object.assign(Object.assign({},e),{uid:t}));return new T(n)}))}update(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}`,i=yield this.httpRequest.patch(e,t);return i.enqueuedAt=new Date(i.enqueuedAt),i}))}delete(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}`,e=yield this.httpRequest.delete(t);return new T(e)}))}getTasks(t={}){return o(this,void 0,void 0,(function*(){return yield this.tasks.getTasks(Object.assign(Object.assign({},t),{indexUids:[this.uid]}))}))}getTask(t){return o(this,void 0,void 0,(function*(){return yield this.tasks.getTask(t)}))}waitForTasks(t,{timeOutMs:e=5e3,intervalMs:i=50}={}){return o(this,void 0,void 0,(function*(){return yield this.tasks.waitForTasks(t,{timeOutMs:e,intervalMs:i})}))}waitForTask(t,{timeOutMs:e=5e3,intervalMs:i=50}={}){return o(this,void 0,void 0,(function*(){return yield this.tasks.waitForTask(t,{timeOutMs:e,intervalMs:i})}))}getStats(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/stats`;return yield this.httpRequest.get(t)}))}getDocuments(t={}){var e;return o(this,void 0,void 0,(function*(){if(void 0===(t=v(t)).filter){const i=`indexes/${this.uid}/documents`,s=Array.isArray(null==t?void 0:t.fields)?{fields:null===(e=null==t?void 0:t.fields)||void 0===e?void 0:e.join(",")}:{};return yield this.httpRequest.get(i,Object.assign(Object.assign({},t),s))}try{const e=`indexes/${this.uid}/documents/fetch`;return yield this.httpRequest.post(e,t)}catch(t){throw(t instanceof u||t instanceof a)&&(t.message=l(t.message,"getDocuments")),t}}))}getDocument(t,e){return o(this,void 0,void 0,(function*(){const i=`indexes/${this.uid}/documents/${t}`,s=(()=>{var t;if(Array.isArray(null==e?void 0:e.fields))return null===(t=null==e?void 0:e.fields)||void 0===t?void 0:t.join(",")})();return yield this.httpRequest.get(i,v(Object.assign(Object.assign({},e),{fields:s})))}))}addDocuments(t,e){return o(this,void 0,void 0,(function*(){const i=`indexes/${this.uid}/documents`,s=yield this.httpRequest.post(i,t,e);return new T(s)}))}addDocumentsFromString(t,e,i){return o(this,void 0,void 0,(function*(){const s=`indexes/${this.uid}/documents`,n=yield this.httpRequest.post(s,t,i,{headers:{"Content-Type":e}});return new T(n)}))}addDocumentsInBatches(t,e=1e3,i){return o(this,void 0,void 0,(function*(){const s=[];for(let n=0;n<t.length;n+=e)s.push(yield this.addDocuments(t.slice(n,n+e),i));return s}))}updateDocuments(t,e){return o(this,void 0,void 0,(function*(){const i=`indexes/${this.uid}/documents`,s=yield this.httpRequest.put(i,t,e);return new T(s)}))}updateDocumentsInBatches(t,e=1e3,i){return o(this,void 0,void 0,(function*(){const s=[];for(let n=0;n<t.length;n+=e)s.push(yield this.updateDocuments(t.slice(n,n+e),i));return s}))}updateDocumentsFromString(t,e,i){return o(this,void 0,void 0,(function*(){const s=`indexes/${this.uid}/documents`,n=yield this.httpRequest.put(s,t,i,{headers:{"Content-Type":e}});return new T(n)}))}deleteDocument(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/documents/${t}`,i=yield this.httpRequest.delete(e);return i.enqueuedAt=new Date(i.enqueuedAt),i}))}deleteDocuments(t){return o(this,void 0,void 0,(function*(){const e=!Array.isArray(t)&&"object"==typeof t,i=e?"documents/delete":"documents/delete-batch",s=`indexes/${this.uid}/${i}`;try{const e=yield this.httpRequest.post(s,t);return new T(e)}catch(t){throw(t instanceof u&&e||t instanceof a)&&(t.message=l(t.message,"deleteDocuments")),t}}))}deleteAllDocuments(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/documents`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getSettings(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings`;return yield this.httpRequest.get(t)}))}updateSettings(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings`,i=yield this.httpRequest.patch(e,t);return i.enqueued=new Date(i.enqueuedAt),i}))}resetSettings(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getPagination(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/pagination`;return yield this.httpRequest.get(t)}))}updatePagination(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/pagination`,i=yield this.httpRequest.patch(e,t);return new T(i)}))}resetPagination(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/pagination`,e=yield this.httpRequest.delete(t);return new T(e)}))}getSynonyms(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/synonyms`;return yield this.httpRequest.get(t)}))}updateSynonyms(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/synonyms`,i=yield this.httpRequest.put(e,t);return new T(i)}))}resetSynonyms(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/synonyms`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getStopWords(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/stop-words`;return yield this.httpRequest.get(t)}))}updateStopWords(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/stop-words`,i=yield this.httpRequest.put(e,t);return new T(i)}))}resetStopWords(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/stop-words`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getRankingRules(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/ranking-rules`;return yield this.httpRequest.get(t)}))}updateRankingRules(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/ranking-rules`,i=yield this.httpRequest.put(e,t);return new T(i)}))}resetRankingRules(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/ranking-rules`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getDistinctAttribute(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/distinct-attribute`;return yield this.httpRequest.get(t)}))}updateDistinctAttribute(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/distinct-attribute`,i=yield this.httpRequest.put(e,t);return new T(i)}))}resetDistinctAttribute(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/distinct-attribute`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getFilterableAttributes(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/filterable-attributes`;return yield this.httpRequest.get(t)}))}updateFilterableAttributes(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/filterable-attributes`,i=yield this.httpRequest.put(e,t);return new T(i)}))}resetFilterableAttributes(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/filterable-attributes`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getSortableAttributes(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/sortable-attributes`;return yield this.httpRequest.get(t)}))}updateSortableAttributes(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/sortable-attributes`,i=yield this.httpRequest.put(e,t);return new T(i)}))}resetSortableAttributes(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/sortable-attributes`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getSearchableAttributes(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/searchable-attributes`;return yield this.httpRequest.get(t)}))}updateSearchableAttributes(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/searchable-attributes`,i=yield this.httpRequest.put(e,t);return new T(i)}))}resetSearchableAttributes(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/searchable-attributes`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getDisplayedAttributes(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/displayed-attributes`;return yield this.httpRequest.get(t)}))}updateDisplayedAttributes(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/displayed-attributes`,i=yield this.httpRequest.put(e,t);return new T(i)}))}resetDisplayedAttributes(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/displayed-attributes`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getTypoTolerance(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/typo-tolerance`;return yield this.httpRequest.get(t)}))}updateTypoTolerance(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/typo-tolerance`,i=yield this.httpRequest.patch(e,t);return i.enqueuedAt=new Date(i.enqueuedAt),i}))}resetTypoTolerance(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/typo-tolerance`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getFaceting(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/faceting`;return yield this.httpRequest.get(t)}))}updateFaceting(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/faceting`,i=yield this.httpRequest.patch(e,t);return new T(i)}))}resetFaceting(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/faceting`,e=yield this.httpRequest.delete(t);return new T(e)}))}getSeparatorTokens(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/separator-tokens`;return yield this.httpRequest.get(t)}))}updateSeparatorTokens(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/separator-tokens`,i=yield this.httpRequest.put(e,t);return new T(i)}))}resetSeparatorTokens(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/separator-tokens`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getNonSeparatorTokens(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/non-separator-tokens`;return yield this.httpRequest.get(t)}))}updateNonSeparatorTokens(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/non-separator-tokens`,i=yield this.httpRequest.put(e,t);return new T(i)}))}resetNonSeparatorTokens(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/non-separator-tokens`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getDictionary(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/dictionary`;return yield this.httpRequest.get(t)}))}updateDictionary(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/dictionary`,i=yield this.httpRequest.put(e,t);return new T(i)}))}resetDictionary(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/dictionary`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getProximityPrecision(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/proximity-precision`;return yield this.httpRequest.get(t)}))}updateProximityPrecision(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/proximity-precision`,i=yield this.httpRequest.put(e,t);return new T(i)}))}resetProximityPrecision(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/proximity-precision`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}getEmbedders(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/embedders`;return yield this.httpRequest.get(t)}))}updateEmbedders(t){return o(this,void 0,void 0,(function*(){const e=`indexes/${this.uid}/settings/embedders`,i=yield this.httpRequest.patch(e,t);return new T(i)}))}resetEmbedders(){return o(this,void 0,void 0,(function*(){const t=`indexes/${this.uid}/settings/embedders`,e=yield this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}))}}function S(t){return Buffer.from(JSON.stringify(t)).toString("base64")}class D{constructor(t){this.config=t}generateTenantToken(e,i,s){const n=(null==s?void 0:s.apiKey)||this.config.apiKey||"",r=e||"",o=null==s?void 0:s.expiresAt;!function(t){const{searchRules:e,uid:i,apiKey:s,expiresAt:n}=t;if(n){if(!(n instanceof Date))throw new d("Meilisearch: The expiredAt field must be an instance of Date.");if(n.getTime()<Date.now())throw new d("Meilisearch: The expiresAt field must be a date in the future.")}if(e&&"object"!=typeof e&&!Array.isArray(e))throw new d("Meilisearch: The search rules added in the token generation must be of type array or object.");if(!s||"string"!=typeof s)throw new d("Meilisearch: The API key used for the token generation must exist and be of type string.");if(!i||"string"!=typeof i)throw new d("Meilisearch: The uid of the api key used for the token generation must exist, be of type string and comply to the uuid4 format.");if(!/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi.test(i))throw new d("Meilisearch: The uid of your key is not a valid uuid4. To find out the uid of your key use getKey().")}({apiKey:n,uid:r,expiresAt:o,searchRules:i});const u=S({alg:"HS256",typ:"JWT"}).replace(/=/g,""),a=function(t){const{searchRules:e,uid:i,expiresAt:s}=t;return S({searchRules:e,apiKeyUid:i,exp:s?Math.floor(s.getTime()/1e3):void 0}).replace(/=/g,"")}({searchRules:i,uid:r,expiresAt:o}),h=function(e,i,s){return t.createHmac("sha256",e).update(`${i}.${s}`).digest("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}(n,u,a);return`${u}.${a}.${h}`}}class R extends class{constructor(t){this.config=t,this.httpRequest=new f(t),this.tasks=new E(t)}index(t){return new g(this.config,t)}getIndex(t){return o(this,void 0,void 0,(function*(){return new g(this.config,t).fetchInfo()}))}getRawIndex(t){return o(this,void 0,void 0,(function*(){return new g(this.config,t).getRawInfo()}))}getIndexes(t={}){return o(this,void 0,void 0,(function*(){const e=yield this.getRawIndexes(t),i=e.results.map((t=>new g(this.config,t.uid,t.primaryKey)));return Object.assign(Object.assign({},e),{results:i})}))}getRawIndexes(t={}){return o(this,void 0,void 0,(function*(){return yield this.httpRequest.get("indexes",t)}))}createIndex(t,e={}){return o(this,void 0,void 0,(function*(){return yield g.create(t,e,this.config)}))}updateIndex(t,e={}){return o(this,void 0,void 0,(function*(){return yield new g(this.config,t).update(e)}))}deleteIndex(t){return o(this,void 0,void 0,(function*(){return yield new g(this.config,t).delete()}))}deleteIndexIfExists(t){return o(this,void 0,void 0,(function*(){try{return yield this.deleteIndex(t),!0}catch(t){if(t.code===r.INDEX_NOT_FOUND)return!1;throw t}}))}swapIndexes(t){return o(this,void 0,void 0,(function*(){return yield this.httpRequest.post("/swap-indexes",t)}))}multiSearch(t,e){return o(this,void 0,void 0,(function*(){return yield this.httpRequest.post("multi-search",t,void 0,e)}))}getTasks(t={}){return o(this,void 0,void 0,(function*(){return yield this.tasks.getTasks(t)}))}getTask(t){return o(this,void 0,void 0,(function*(){return yield this.tasks.getTask(t)}))}waitForTasks(t,{timeOutMs:e=5e3,intervalMs:i=50}={}){return o(this,void 0,void 0,(function*(){return yield this.tasks.waitForTasks(t,{timeOutMs:e,intervalMs:i})}))}waitForTask(t,{timeOutMs:e=5e3,intervalMs:i=50}={}){return o(this,void 0,void 0,(function*(){return yield this.tasks.waitForTask(t,{timeOutMs:e,intervalMs:i})}))}cancelTasks(t){return o(this,void 0,void 0,(function*(){return yield this.tasks.cancelTasks(t)}))}deleteTasks(t={}){return o(this,void 0,void 0,(function*(){return yield this.tasks.deleteTasks(t)}))}getKeys(t={}){return o(this,void 0,void 0,(function*(){const e=yield this.httpRequest.get("keys",t);return e.results=e.results.map((t=>Object.assign(Object.assign({},t),{createdAt:new Date(t.createdAt),updatedAt:new Date(t.updatedAt)}))),e}))}getKey(t){return o(this,void 0,void 0,(function*(){const e=`keys/${t}`;return yield this.httpRequest.get(e)}))}createKey(t){return o(this,void 0,void 0,(function*(){return yield this.httpRequest.post("keys",t)}))}updateKey(t,e){return o(this,void 0,void 0,(function*(){const i=`keys/${t}`;return yield this.httpRequest.patch(i,e)}))}deleteKey(t){return o(this,void 0,void 0,(function*(){const e=`keys/${t}`;return yield this.httpRequest.delete(e)}))}health(){return o(this,void 0,void 0,(function*(){return yield this.httpRequest.get("health")}))}isHealthy(){return o(this,void 0,void 0,(function*(){try{const t="health";return yield this.httpRequest.get(t),!0}catch(t){return!1}}))}getStats(){return o(this,void 0,void 0,(function*(){return yield this.httpRequest.get("stats")}))}getVersion(){return o(this,void 0,void 0,(function*(){return yield this.httpRequest.get("version")}))}createDump(){return o(this,void 0,void 0,(function*(){const t=yield this.httpRequest.post("dumps");return new T(t)}))}createSnapshot(){return o(this,void 0,void 0,(function*(){const t=yield this.httpRequest.post("snapshots");return new T(t)}))}generateTenantToken(t,e,i){const s=new Error;throw new Error(`Meilisearch: failed to generate a tenant token. Generation of a token only works in a node environment \n ${s.stack}.`)}}{constructor(t){super(t),this.tokens=new D(t)}generateTenantToken(t,e,i){return"undefined"==typeof window?this.tokens.generateTenantToken(t,e,i):super.generateTenantToken(t,e,i)}}export{i as ContentTypeEnum,T as EnqueuedTask,r as ErrorStatusCode,g as Index,e as MatchingStrategies,R as MeiliSearch,a as MeiliSearchApiError,u as MeiliSearchCommunicationError,d as MeiliSearchError,_ as MeiliSearchTimeOutError,R as Meilisearch,y as Task,E as TaskClient,s as TaskStatus,n as TaskTypes,R as default,c as httpErrorHandler,h as httpResponseErrorHandler,l as versionErrorHintMessage};
import{createHmac as t}from"crypto";const e={ALL:"all",LAST:"last"},s={JSON:"application/json",CSV:"text/csv",NDJSON:"application/x-ndjson"},i={TASK_SUCCEEDED:"succeeded",TASK_PROCESSING:"processing",TASK_FAILED:"failed",TASK_ENQUEUED:"enqueued",TASK_CANCELED:"canceled"},n={DOCUMENTS_ADDITION_OR_UPDATE:"documentAdditionOrUpdate",DOCUMENT_DELETION:"documentDeletion",DUMP_CREATION:"dumpCreation",INDEX_CREATION:"indexCreation",INDEX_DELETION:"indexDeletion",INDEXES_SWAP:"indexSwap",INDEX_UPDATE:"indexUpdate",SETTINGS_UPDATE:"settingsUpdate",SNAPSHOT_CREATION:"snapshotCreation",TASK_CANCELATION:"taskCancelation",TASK_DELETION:"taskDeletion"},a={INDEX_CREATION_FAILED:"index_creation_failed",MISSING_INDEX_UID:"missing_index_uid",INDEX_ALREADY_EXISTS:"index_already_exists",INDEX_NOT_FOUND:"index_not_found",INVALID_INDEX_UID:"invalid_index_uid",INDEX_NOT_ACCESSIBLE:"index_not_accessible",INVALID_INDEX_OFFSET:"invalid_index_offset",INVALID_INDEX_LIMIT:"invalid_index_limit",INVALID_STATE:"invalid_state",PRIMARY_KEY_INFERENCE_FAILED:"primary_key_inference_failed",INDEX_PRIMARY_KEY_ALREADY_EXISTS:"index_primary_key_already_exists",INVALID_INDEX_PRIMARY_KEY:"invalid_index_primary_key",DOCUMENTS_FIELDS_LIMIT_REACHED:"document_fields_limit_reached",MISSING_DOCUMENT_ID:"missing_document_id",INVALID_DOCUMENT_ID:"invalid_document_id",INVALID_CONTENT_TYPE:"invalid_content_type",MISSING_CONTENT_TYPE:"missing_content_type",INVALID_DOCUMENT_FIELDS:"invalid_document_fields",INVALID_DOCUMENT_LIMIT:"invalid_document_limit",INVALID_DOCUMENT_OFFSET:"invalid_document_offset",INVALID_DOCUMENT_FILTER:"invalid_document_filter",MISSING_DOCUMENT_FILTER:"missing_document_filter",INVALID_DOCUMENT_VECTORS_FIELD:"invalid_document_vectors_field",PAYLOAD_TOO_LARGE:"payload_too_large",MISSING_PAYLOAD:"missing_payload",MALFORMED_PAYLOAD:"malformed_payload",NO_SPACE_LEFT_ON_DEVICE:"no_space_left_on_device",INVALID_STORE_FILE:"invalid_store_file",INVALID_RANKING_RULES:"missing_document_id",INVALID_REQUEST:"invalid_request",INVALID_DOCUMENT_GEO_FIELD:"invalid_document_geo_field",INVALID_SEARCH_Q:"invalid_search_q",INVALID_SEARCH_OFFSET:"invalid_search_offset",INVALID_SEARCH_LIMIT:"invalid_search_limit",INVALID_SEARCH_PAGE:"invalid_search_page",INVALID_SEARCH_HITS_PER_PAGE:"invalid_search_hits_per_page",INVALID_SEARCH_ATTRIBUTES_TO_RETRIEVE:"invalid_search_attributes_to_retrieve",INVALID_SEARCH_ATTRIBUTES_TO_CROP:"invalid_search_attributes_to_crop",INVALID_SEARCH_CROP_LENGTH:"invalid_search_crop_length",INVALID_SEARCH_ATTRIBUTES_TO_HIGHLIGHT:"invalid_search_attributes_to_highlight",INVALID_SEARCH_SHOW_MATCHES_POSITION:"invalid_search_show_matches_position",INVALID_SEARCH_FILTER:"invalid_search_filter",INVALID_SEARCH_SORT:"invalid_search_sort",INVALID_SEARCH_FACETS:"invalid_search_facets",INVALID_SEARCH_HIGHLIGHT_PRE_TAG:"invalid_search_highlight_pre_tag",INVALID_SEARCH_HIGHLIGHT_POST_TAG:"invalid_search_highlight_post_tag",INVALID_SEARCH_CROP_MARKER:"invalid_search_crop_marker",INVALID_SEARCH_MATCHING_STRATEGY:"invalid_search_matching_strategy",INVALID_SEARCH_VECTOR:"invalid_search_vector",INVALID_SEARCH_ATTRIBUTES_TO_SEARCH_ON:"invalid_search_attributes_to_search_on",BAD_REQUEST:"bad_request",DOCUMENT_NOT_FOUND:"document_not_found",INTERNAL:"internal",INVALID_API_KEY:"invalid_api_key",INVALID_API_KEY_DESCRIPTION:"invalid_api_key_description",INVALID_API_KEY_ACTIONS:"invalid_api_key_actions",INVALID_API_KEY_INDEXES:"invalid_api_key_indexes",INVALID_API_KEY_EXPIRES_AT:"invalid_api_key_expires_at",API_KEY_NOT_FOUND:"api_key_not_found",IMMUTABLE_API_KEY_UID:"immutable_api_key_uid",IMMUTABLE_API_KEY_ACTIONS:"immutable_api_key_actions",IMMUTABLE_API_KEY_INDEXES:"immutable_api_key_indexes",IMMUTABLE_API_KEY_EXPIRES_AT:"immutable_api_key_expires_at",IMMUTABLE_API_KEY_CREATED_AT:"immutable_api_key_created_at",IMMUTABLE_API_KEY_UPDATED_AT:"immutable_api_key_updated_at",MISSING_AUTHORIZATION_HEADER:"missing_authorization_header",UNRETRIEVABLE_DOCUMENT:"unretrievable_document",MAX_DATABASE_SIZE_LIMIT_REACHED:"database_size_limit_reached",TASK_NOT_FOUND:"task_not_found",DUMP_PROCESS_FAILED:"dump_process_failed",DUMP_NOT_FOUND:"dump_not_found",INVALID_SWAP_DUPLICATE_INDEX_FOUND:"invalid_swap_duplicate_index_found",INVALID_SWAP_INDEXES:"invalid_swap_indexes",MISSING_SWAP_INDEXES:"missing_swap_indexes",MISSING_MASTER_KEY:"missing_master_key",INVALID_TASK_TYPES:"invalid_task_types",INVALID_TASK_UIDS:"invalid_task_uids",INVALID_TASK_STATUSES:"invalid_task_statuses",INVALID_TASK_LIMIT:"invalid_task_limit",INVALID_TASK_FROM:"invalid_task_from",INVALID_TASK_CANCELED_BY:"invalid_task_canceled_by",MISSING_TASK_FILTERS:"missing_task_filters",TOO_MANY_OPEN_FILES:"too_many_open_files",IO_ERROR:"io_error",INVALID_TASK_INDEX_UIDS:"invalid_task_index_uids",IMMUTABLE_INDEX_UID:"immutable_index_uid",IMMUTABLE_INDEX_CREATED_AT:"immutable_index_created_at",IMMUTABLE_INDEX_UPDATED_AT:"immutable_index_updated_at",INVALID_SETTINGS_DISPLAYED_ATTRIBUTES:"invalid_settings_displayed_attributes",INVALID_SETTINGS_SEARCHABLE_ATTRIBUTES:"invalid_settings_searchable_attributes",INVALID_SETTINGS_FILTERABLE_ATTRIBUTES:"invalid_settings_filterable_attributes",INVALID_SETTINGS_SORTABLE_ATTRIBUTES:"invalid_settings_sortable_attributes",INVALID_SETTINGS_RANKING_RULES:"invalid_settings_ranking_rules",INVALID_SETTINGS_STOP_WORDS:"invalid_settings_stop_words",INVALID_SETTINGS_SYNONYMS:"invalid_settings_synonyms",INVALID_SETTINGS_DISTINCT_ATTRIBUTE:"invalid_settings_distinct_attribute",INVALID_SETTINGS_TYPO_TOLERANCE:"invalid_settings_typo_tolerance",INVALID_SETTINGS_FACETING:"invalid_settings_faceting",INVALID_SETTINGS_PAGINATION:"invalid_settings_pagination",INVALID_SETTINGS_SEARCH_CUTOFF_MS:"invalid_settings_search_cutoff_ms",INVALID_TASK_BEFORE_ENQUEUED_AT:"invalid_task_before_enqueued_at",INVALID_TASK_AFTER_ENQUEUED_AT:"invalid_task_after_enqueued_at",INVALID_TASK_BEFORE_STARTED_AT:"invalid_task_before_started_at",INVALID_TASK_AFTER_STARTED_AT:"invalid_task_after_started_at",INVALID_TASK_BEFORE_FINISHED_AT:"invalid_task_before_finished_at",INVALID_TASK_AFTER_FINISHED_AT:"invalid_task_after_finished_at",MISSING_API_KEY_ACTIONS:"missing_api_key_actions",MISSING_API_KEY_INDEXES:"missing_api_key_indexes",MISSING_API_KEY_EXPIRES_AT:"missing_api_key_expires_at",INVALID_API_KEY_LIMIT:"invalid_api_key_limit",INVALID_API_KEY_OFFSET:"invalid_api_key_offset",INVALID_FACET_SEARCH_FACET_NAME:"invalid_facet_search_facet_name",MISSING_FACET_SEARCH_FACET_NAME:"missing_facet_search_facet_name",INVALID_FACET_SEARCH_FACET_QUERY:"invalid_facet_search_facet_query"};class r extends Error{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype),this.name="MeiliSearchError",Error.captureStackTrace&&Error.captureStackTrace(this,r)}}class u extends r{statusCode;errno;code;stack;constructor(t,e,s,i){super(t),Object.setPrototypeOf(this,u.prototype),this.name="MeiliSearchCommunicationError",e instanceof Response&&(this.message=e.statusText,this.statusCode=e.status),e instanceof Error&&(this.errno=e.errno,this.code=e.code),i?(this.stack=i,this.stack=this.stack?.replace(/(TypeError|FetchError)/,this.name),this.stack=this.stack?.replace("Failed to fetch",`request to ${s} failed, reason: connect ECONNREFUSED`),this.stack=this.stack?.replace("Not Found",`Not Found: ${s}`)):Error.captureStackTrace&&Error.captureStackTrace(this,u)}}const o=class extends r{httpStatus;code;link;type;stack;constructor(t,e){super(t.message),Object.setPrototypeOf(this,o.prototype),this.name="MeiliSearchApiError",this.code=t.code,this.type=t.type,this.link=t.link,this.message=t.message,this.httpStatus=e,Error.captureStackTrace&&Error.captureStackTrace(this,o)}};async function c(t){if(!t.ok){let e;try{e=await t.json()}catch(e){throw new u(t.statusText,t,t.url)}throw new o(e,t.status)}return t}function d(t,e,s){if("MeiliSearchApiError"!==t.name)throw new u(t.message,t,s,e);throw t}class _ extends r{constructor(t){super(t),Object.setPrototypeOf(this,_.prototype),this.name="MeiliSearchTimeOutError",Error.captureStackTrace&&Error.captureStackTrace(this,_)}}function h(t,e){return`${t}\nHint: It might not be working because maybe you're not up to date with the Meilisearch version that ${e} call requires.`}function p(t){return Object.entries(t).reduce(((t,e)=>{const[s,i]=e;return void 0!==i&&(t[s]=i),t}),{})}async function A(t){return await new Promise((e=>setTimeout(e,t)))}function l(t){return Object.keys(t).reduce(((e,s)=>{const i=t[s];return void 0===i?e:Array.isArray(i)?{...e,[s]:i.join(",")}:i instanceof Date?{...e,[s]:i.toISOString()}:{...e,[s]:i}}),{})}function I(t){const e="X-Meilisearch-Client",s="Meilisearch JavaScript (v0.39.0)",i=function(t){if(Array.isArray(t))return t.reduce(((t,e)=>(t[e[0]]=e[1],t)),{});if("has"in t){const e={};return t.forEach(((t,s)=>e[s]=t)),e}return Object.assign({},t)}(t.requestConfig?.headers??{});if(t.apiKey&&!i.Authorization&&(i.Authorization=`Bearer ${t.apiKey}`),i["Content-Type"]||(i["Content-Type"]="application/json"),t.clientAgents&&Array.isArray(t.clientAgents)){const n=t.clientAgents.concat(s);i[e]=n.join(" ; ")}else{if(t.clientAgents&&!Array.isArray(t.clientAgents))throw new r(`Meilisearch: The header "${e}" should be an array of string(s).\n`);i[e]=s}return i}class T{headers;url;requestConfig;httpClient;requestTimeout;constructor(t){this.headers=I(t),this.requestConfig=t.requestConfig,this.httpClient=t.httpClient,this.requestTimeout=t.timeout;try{const e=function(t){try{return(e=t=function(t){return t.startsWith("https://")||t.startsWith("http://")?t:`http://${t}`}(t)).endsWith("/")||(e+="/"),t=e}catch(t){throw new r("The provided host is not valid.")}var e}(t.host);this.url=new URL(e)}catch(t){throw new r("The provided host is not valid.")}}async request({method:t,url:e,params:s,body:i,config:n={}}){"undefined"==typeof fetch&&require("cross-fetch/polyfill");const a=new URL(e,this.url);if(s){const t=new URLSearchParams;Object.keys(s).filter((t=>null!==s[t])).map((e=>t.set(e,s[e]))),a.search=t.toString()}n.headers?.["Content-Type"]||(i=JSON.stringify(i));const r={...this.headers,...n.headers};try{const e=this.fetchWithTimeout(a.toString(),{...n,...this.requestConfig,method:t,body:i,headers:r},this.requestTimeout);if(this.httpClient)return await e;const s=await e.then((t=>c(t)));return await s.json().catch((()=>{}))}catch(t){d(t,t.stack,a.toString())}}async fetchWithTimeout(t,e,s){return new Promise(((i,n)=>{const a=[(this.httpClient?this.httpClient:fetch)(t,e)];let r;if(s){const t=new Promise(((t,e)=>{r=setTimeout((()=>{e(new Error("Error: Request Timed Out"))}),s)}));a.push(t)}Promise.race(a).then(i).catch(n).finally((()=>{clearTimeout(r)}))}))}async get(t,e,s){return await this.request({method:"GET",url:t,params:e,config:s})}async post(t,e,s,i){return await this.request({method:"POST",url:t,body:e,params:s,config:i})}async put(t,e,s,i){return await this.request({method:"PUT",url:t,body:e,params:s,config:i})}async patch(t,e,s,i){return await this.request({method:"PATCH",url:t,body:e,params:s,config:i})}async delete(t,e,s,i){return await this.request({method:"DELETE",url:t,body:e,params:s,config:i})}}class y{taskUid;indexUid;status;type;enqueuedAt;constructor(t){this.taskUid=t.taskUid,this.indexUid=t.indexUid,this.status=t.status,this.type=t.type,this.enqueuedAt=new Date(t.enqueuedAt)}}class E{indexUid;status;type;uid;canceledBy;details;error;duration;startedAt;enqueuedAt;finishedAt;constructor(t){this.indexUid=t.indexUid,this.status=t.status,this.type=t.type,this.uid=t.uid,this.details=t.details,this.canceledBy=t.canceledBy,this.error=t.error,this.duration=t.duration,this.startedAt=new Date(t.startedAt),this.enqueuedAt=new Date(t.enqueuedAt),this.finishedAt=new Date(t.finishedAt)}}class g{httpRequest;constructor(t){this.httpRequest=new T(t)}async getTask(t){const e=`tasks/${t}`,s=await this.httpRequest.get(e);return new E(s)}async getTasks(t={}){const e=await this.httpRequest.get("tasks",l(t));return{...e,results:e.results.map((t=>new E(t)))}}async waitForTask(t,{timeOutMs:e=5e3,intervalMs:s=50}={}){const n=Date.now();for(;Date.now()-n<e;){const e=await this.getTask(t);if(![i.TASK_ENQUEUED,i.TASK_PROCESSING].includes(e.status))return e;await A(s)}throw new _(`timeout of ${e}ms has exceeded on process ${t} when waiting a task to be resolved.`)}async waitForTasks(t,{timeOutMs:e=5e3,intervalMs:s=50}={}){const i=[];for(const n of t){const t=await this.waitForTask(n,{timeOutMs:e,intervalMs:s});i.push(t)}return i}async cancelTasks(t={}){const e=await this.httpRequest.post("tasks/cancel",{},l(t));return new y(e)}async deleteTasks(t={}){const e=await this.httpRequest.delete("tasks",{},l(t));return new y(e)}}class w{uid;primaryKey;createdAt;updatedAt;httpRequest;tasks;constructor(t,e,s){this.uid=e,this.primaryKey=s,this.httpRequest=new T(t),this.tasks=new g(t)}async search(t,e,s){const i=`indexes/${this.uid}/search`;return await this.httpRequest.post(i,p({q:t,...e}),void 0,s)}async searchGet(t,e,s){const i=`indexes/${this.uid}/search`,n={q:t,...e,filter:(t=>{if("string"==typeof t)return t;if(Array.isArray(t))throw new r("The filter query parameter should be in string format when using searchGet")})(e?.filter),sort:e?.sort?.join(","),facets:e?.facets?.join(","),attributesToRetrieve:e?.attributesToRetrieve?.join(","),attributesToCrop:e?.attributesToCrop?.join(","),attributesToHighlight:e?.attributesToHighlight?.join(","),vector:e?.vector?.join(","),attributesToSearchOn:e?.attributesToSearchOn?.join(",")};return await this.httpRequest.get(i,p(n),s)}async searchForFacetValues(t,e){const s=`indexes/${this.uid}/facet-search`;return await this.httpRequest.post(s,p(t),void 0,e)}async getRawInfo(){const t=`indexes/${this.uid}`,e=await this.httpRequest.get(t);return this.primaryKey=e.primaryKey,this.updatedAt=new Date(e.updatedAt),this.createdAt=new Date(e.createdAt),e}async fetchInfo(){return await this.getRawInfo(),this}async fetchPrimaryKey(){return this.primaryKey=(await this.getRawInfo()).primaryKey,this.primaryKey}static async create(t,e={},s){const i=new T(s),n=await i.post("indexes",{...e,uid:t});return new y(n)}async update(t){const e=`indexes/${this.uid}`,s=await this.httpRequest.patch(e,t);return s.enqueuedAt=new Date(s.enqueuedAt),s}async delete(){const t=`indexes/${this.uid}`,e=await this.httpRequest.delete(t);return new y(e)}async getTasks(t={}){return await this.tasks.getTasks({...t,indexUids:[this.uid]})}async getTask(t){return await this.tasks.getTask(t)}async waitForTasks(t,{timeOutMs:e=5e3,intervalMs:s=50}={}){return await this.tasks.waitForTasks(t,{timeOutMs:e,intervalMs:s})}async waitForTask(t,{timeOutMs:e=5e3,intervalMs:s=50}={}){return await this.tasks.waitForTask(t,{timeOutMs:e,intervalMs:s})}async getStats(){const t=`indexes/${this.uid}/stats`;return await this.httpRequest.get(t)}async getDocuments(t={}){if(void 0===(t=p(t)).filter){const e=`indexes/${this.uid}/documents`,s=Array.isArray(t?.fields)?{fields:t?.fields?.join(",")}:{};return await this.httpRequest.get(e,{...t,...s})}try{const e=`indexes/${this.uid}/documents/fetch`;return await this.httpRequest.post(e,t)}catch(t){throw(t instanceof u||t instanceof o)&&(t.message=h(t.message,"getDocuments")),t}}async getDocument(t,e){const s=`indexes/${this.uid}/documents/${t}`,i=(()=>{if(Array.isArray(e?.fields))return e?.fields?.join(",")})();return await this.httpRequest.get(s,p({...e,fields:i}))}async addDocuments(t,e){const s=`indexes/${this.uid}/documents`,i=await this.httpRequest.post(s,t,e);return new y(i)}async addDocumentsFromString(t,e,s){const i=`indexes/${this.uid}/documents`,n=await this.httpRequest.post(i,t,s,{headers:{"Content-Type":e}});return new y(n)}async addDocumentsInBatches(t,e=1e3,s){const i=[];for(let n=0;n<t.length;n+=e)i.push(await this.addDocuments(t.slice(n,n+e),s));return i}async updateDocuments(t,e){const s=`indexes/${this.uid}/documents`,i=await this.httpRequest.put(s,t,e);return new y(i)}async updateDocumentsInBatches(t,e=1e3,s){const i=[];for(let n=0;n<t.length;n+=e)i.push(await this.updateDocuments(t.slice(n,n+e),s));return i}async updateDocumentsFromString(t,e,s){const i=`indexes/${this.uid}/documents`,n=await this.httpRequest.put(i,t,s,{headers:{"Content-Type":e}});return new y(n)}async deleteDocument(t){const e=`indexes/${this.uid}/documents/${t}`,s=await this.httpRequest.delete(e);return s.enqueuedAt=new Date(s.enqueuedAt),s}async deleteDocuments(t){const e=!Array.isArray(t)&&"object"==typeof t,s=e?"documents/delete":"documents/delete-batch",i=`indexes/${this.uid}/${s}`;try{const e=await this.httpRequest.post(i,t);return new y(e)}catch(t){throw(t instanceof u&&e||t instanceof o)&&(t.message=h(t.message,"deleteDocuments")),t}}async deleteAllDocuments(){const t=`indexes/${this.uid}/documents`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getSettings(){const t=`indexes/${this.uid}/settings`;return await this.httpRequest.get(t)}async updateSettings(t){const e=`indexes/${this.uid}/settings`,s=await this.httpRequest.patch(e,t);return s.enqueued=new Date(s.enqueuedAt),s}async resetSettings(){const t=`indexes/${this.uid}/settings`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getPagination(){const t=`indexes/${this.uid}/settings/pagination`;return await this.httpRequest.get(t)}async updatePagination(t){const e=`indexes/${this.uid}/settings/pagination`,s=await this.httpRequest.patch(e,t);return new y(s)}async resetPagination(){const t=`indexes/${this.uid}/settings/pagination`,e=await this.httpRequest.delete(t);return new y(e)}async getSynonyms(){const t=`indexes/${this.uid}/settings/synonyms`;return await this.httpRequest.get(t)}async updateSynonyms(t){const e=`indexes/${this.uid}/settings/synonyms`,s=await this.httpRequest.put(e,t);return new y(s)}async resetSynonyms(){const t=`indexes/${this.uid}/settings/synonyms`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getStopWords(){const t=`indexes/${this.uid}/settings/stop-words`;return await this.httpRequest.get(t)}async updateStopWords(t){const e=`indexes/${this.uid}/settings/stop-words`,s=await this.httpRequest.put(e,t);return new y(s)}async resetStopWords(){const t=`indexes/${this.uid}/settings/stop-words`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getRankingRules(){const t=`indexes/${this.uid}/settings/ranking-rules`;return await this.httpRequest.get(t)}async updateRankingRules(t){const e=`indexes/${this.uid}/settings/ranking-rules`,s=await this.httpRequest.put(e,t);return new y(s)}async resetRankingRules(){const t=`indexes/${this.uid}/settings/ranking-rules`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getDistinctAttribute(){const t=`indexes/${this.uid}/settings/distinct-attribute`;return await this.httpRequest.get(t)}async updateDistinctAttribute(t){const e=`indexes/${this.uid}/settings/distinct-attribute`,s=await this.httpRequest.put(e,t);return new y(s)}async resetDistinctAttribute(){const t=`indexes/${this.uid}/settings/distinct-attribute`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getFilterableAttributes(){const t=`indexes/${this.uid}/settings/filterable-attributes`;return await this.httpRequest.get(t)}async updateFilterableAttributes(t){const e=`indexes/${this.uid}/settings/filterable-attributes`,s=await this.httpRequest.put(e,t);return new y(s)}async resetFilterableAttributes(){const t=`indexes/${this.uid}/settings/filterable-attributes`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getSortableAttributes(){const t=`indexes/${this.uid}/settings/sortable-attributes`;return await this.httpRequest.get(t)}async updateSortableAttributes(t){const e=`indexes/${this.uid}/settings/sortable-attributes`,s=await this.httpRequest.put(e,t);return new y(s)}async resetSortableAttributes(){const t=`indexes/${this.uid}/settings/sortable-attributes`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getSearchableAttributes(){const t=`indexes/${this.uid}/settings/searchable-attributes`;return await this.httpRequest.get(t)}async updateSearchableAttributes(t){const e=`indexes/${this.uid}/settings/searchable-attributes`,s=await this.httpRequest.put(e,t);return new y(s)}async resetSearchableAttributes(){const t=`indexes/${this.uid}/settings/searchable-attributes`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getDisplayedAttributes(){const t=`indexes/${this.uid}/settings/displayed-attributes`;return await this.httpRequest.get(t)}async updateDisplayedAttributes(t){const e=`indexes/${this.uid}/settings/displayed-attributes`,s=await this.httpRequest.put(e,t);return new y(s)}async resetDisplayedAttributes(){const t=`indexes/${this.uid}/settings/displayed-attributes`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getTypoTolerance(){const t=`indexes/${this.uid}/settings/typo-tolerance`;return await this.httpRequest.get(t)}async updateTypoTolerance(t){const e=`indexes/${this.uid}/settings/typo-tolerance`,s=await this.httpRequest.patch(e,t);return s.enqueuedAt=new Date(s.enqueuedAt),s}async resetTypoTolerance(){const t=`indexes/${this.uid}/settings/typo-tolerance`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getFaceting(){const t=`indexes/${this.uid}/settings/faceting`;return await this.httpRequest.get(t)}async updateFaceting(t){const e=`indexes/${this.uid}/settings/faceting`,s=await this.httpRequest.patch(e,t);return new y(s)}async resetFaceting(){const t=`indexes/${this.uid}/settings/faceting`,e=await this.httpRequest.delete(t);return new y(e)}async getSeparatorTokens(){const t=`indexes/${this.uid}/settings/separator-tokens`;return await this.httpRequest.get(t)}async updateSeparatorTokens(t){const e=`indexes/${this.uid}/settings/separator-tokens`,s=await this.httpRequest.put(e,t);return new y(s)}async resetSeparatorTokens(){const t=`indexes/${this.uid}/settings/separator-tokens`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getNonSeparatorTokens(){const t=`indexes/${this.uid}/settings/non-separator-tokens`;return await this.httpRequest.get(t)}async updateNonSeparatorTokens(t){const e=`indexes/${this.uid}/settings/non-separator-tokens`,s=await this.httpRequest.put(e,t);return new y(s)}async resetNonSeparatorTokens(){const t=`indexes/${this.uid}/settings/non-separator-tokens`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getDictionary(){const t=`indexes/${this.uid}/settings/dictionary`;return await this.httpRequest.get(t)}async updateDictionary(t){const e=`indexes/${this.uid}/settings/dictionary`,s=await this.httpRequest.put(e,t);return new y(s)}async resetDictionary(){const t=`indexes/${this.uid}/settings/dictionary`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getProximityPrecision(){const t=`indexes/${this.uid}/settings/proximity-precision`;return await this.httpRequest.get(t)}async updateProximityPrecision(t){const e=`indexes/${this.uid}/settings/proximity-precision`,s=await this.httpRequest.put(e,t);return new y(s)}async resetProximityPrecision(){const t=`indexes/${this.uid}/settings/proximity-precision`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getEmbedders(){const t=`indexes/${this.uid}/settings/embedders`;return await this.httpRequest.get(t)}async updateEmbedders(t){const e=`indexes/${this.uid}/settings/embedders`,s=await this.httpRequest.patch(e,t);return new y(s)}async resetEmbedders(){const t=`indexes/${this.uid}/settings/embedders`,e=await this.httpRequest.delete(t);return e.enqueuedAt=new Date(e.enqueuedAt),e}async getSearchCutoffMs(){const t=`indexes/${this.uid}/settings/search-cutoff-ms`;return await this.httpRequest.get(t)}async updateSearchCutoffMs(t){const e=`indexes/${this.uid}/settings/search-cutoff-ms`,s=await this.httpRequest.put(e,t);return new y(s)}async resetSearchCutoffMs(){const t=`indexes/${this.uid}/settings/search-cutoff-ms`,e=await this.httpRequest.delete(t);return new y(e)}}function S(t){return Buffer.from(JSON.stringify(t)).toString("base64")}class D{config;constructor(t){this.config=t}generateTenantToken(e,s,i){const n=i?.apiKey||this.config.apiKey||"",a=e||"",u=i?.expiresAt;!function(t){const{searchRules:e,uid:s,apiKey:i,expiresAt:n}=t;if(n){if(!(n instanceof Date))throw new r("Meilisearch: The expiredAt field must be an instance of Date.");if(n.getTime()<Date.now())throw new r("Meilisearch: The expiresAt field must be a date in the future.")}if(e&&"object"!=typeof e&&!Array.isArray(e))throw new r("Meilisearch: The search rules added in the token generation must be of type array or object.");if(!i||"string"!=typeof i)throw new r("Meilisearch: The API key used for the token generation must exist and be of type string.");if(!s||"string"!=typeof s)throw new r("Meilisearch: The uid of the api key used for the token generation must exist, be of type string and comply to the uuid4 format.");if(!/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi.test(s))throw new r("Meilisearch: The uid of your key is not a valid uuid4. To find out the uid of your key use getKey().")}({apiKey:n,uid:a,expiresAt:u,searchRules:s});const o=S({alg:"HS256",typ:"JWT"}).replace(/=/g,""),c=function(t){const{searchRules:e,uid:s,expiresAt:i}=t;return S({searchRules:e,apiKeyUid:s,exp:i?Math.floor(i.getTime()/1e3):void 0}).replace(/=/g,"")}({searchRules:s,uid:a,expiresAt:u}),d=function(e,s,i){return t("sha256",e).update(`${s}.${i}`).digest("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}(n,o,c);return`${o}.${c}.${d}`}}class R extends class{config;httpRequest;tasks;constructor(t){this.config=t,this.httpRequest=new T(t),this.tasks=new g(t)}index(t){return new w(this.config,t)}async getIndex(t){return new w(this.config,t).fetchInfo()}async getRawIndex(t){return new w(this.config,t).getRawInfo()}async getIndexes(t={}){const e=await this.getRawIndexes(t),s=e.results.map((t=>new w(this.config,t.uid,t.primaryKey)));return{...e,results:s}}async getRawIndexes(t={}){return await this.httpRequest.get("indexes",t)}async createIndex(t,e={}){return await w.create(t,e,this.config)}async updateIndex(t,e={}){return await new w(this.config,t).update(e)}async deleteIndex(t){return await new w(this.config,t).delete()}async deleteIndexIfExists(t){try{return await this.deleteIndex(t),!0}catch(t){if(t.code===a.INDEX_NOT_FOUND)return!1;throw t}}async swapIndexes(t){return await this.httpRequest.post("/swap-indexes",t)}async multiSearch(t,e){return await this.httpRequest.post("multi-search",t,void 0,e)}async getTasks(t={}){return await this.tasks.getTasks(t)}async getTask(t){return await this.tasks.getTask(t)}async waitForTasks(t,{timeOutMs:e=5e3,intervalMs:s=50}={}){return await this.tasks.waitForTasks(t,{timeOutMs:e,intervalMs:s})}async waitForTask(t,{timeOutMs:e=5e3,intervalMs:s=50}={}){return await this.tasks.waitForTask(t,{timeOutMs:e,intervalMs:s})}async cancelTasks(t){return await this.tasks.cancelTasks(t)}async deleteTasks(t={}){return await this.tasks.deleteTasks(t)}async getKeys(t={}){const e=await this.httpRequest.get("keys",t);return e.results=e.results.map((t=>({...t,createdAt:new Date(t.createdAt),updatedAt:new Date(t.updatedAt)}))),e}async getKey(t){const e=`keys/${t}`;return await this.httpRequest.get(e)}async createKey(t){return await this.httpRequest.post("keys",t)}async updateKey(t,e){const s=`keys/${t}`;return await this.httpRequest.patch(s,e)}async deleteKey(t){const e=`keys/${t}`;return await this.httpRequest.delete(e)}async health(){return await this.httpRequest.get("health")}async isHealthy(){try{const t="health";return await this.httpRequest.get(t),!0}catch(t){return!1}}async getStats(){return await this.httpRequest.get("stats")}async getVersion(){return await this.httpRequest.get("version")}async createDump(){const t=await this.httpRequest.post("dumps");return new y(t)}async createSnapshot(){const t=await this.httpRequest.post("snapshots");return new y(t)}generateTenantToken(t,e,s){const i=new Error;throw new Error(`Meilisearch: failed to generate a tenant token. Generation of a token only works in a node environment \n ${i.stack}.`)}}{tokens;constructor(t){super(t),this.tokens=new D(t)}generateTenantToken(t,e,s){return"undefined"==typeof window?this.tokens.generateTenantToken(t,e,s):super.generateTenantToken(t,e,s)}}export{s as ContentTypeEnum,y as EnqueuedTask,a as ErrorStatusCode,w as Index,e as MatchingStrategies,R as MeiliSearch,o as MeiliSearchApiError,u as MeiliSearchCommunicationError,r as MeiliSearchError,_ as MeiliSearchTimeOutError,R as Meilisearch,E as Task,g as TaskClient,i as TaskStatus,n as TaskTypes,R as default,d as httpErrorHandler,c as httpResponseErrorHandler,h as versionErrorHintMessage};
//# sourceMappingURL=meilisearch.esm.min.js.map

@@ -0,0 +0,0 @@ export * from './types';

@@ -0,0 +0,0 @@ import { Config } from '../types';

@@ -0,0 +0,0 @@ import { Index } from '../indexes';

@@ -0,0 +0,0 @@ import { Client } from './client';

@@ -0,0 +0,0 @@ import { EnqueuedTaskObject } from './types';

@@ -0,0 +0,0 @@ import { FetchError } from '../types';

@@ -0,0 +0,0 @@ export * from './http-error-handler';

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -0,0 +0,0 @@ import { FetchError } from '../types';

@@ -0,0 +0,0 @@ declare class MeiliSearchError extends Error {

@@ -0,0 +0,0 @@ import { MeiliSearchError } from './meilisearch-error';

export declare function versionErrorHintMessage(message: string, method: string): string;
//# sourceMappingURL=version-hint-message.d.ts.map

@@ -0,0 +0,0 @@ import { Config, EnqueuedTaskObject } from './types';

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

// Type definitions for meilisearch 0.38.0
// Type definitions for meilisearch 0.39.0
// Project: https://github.com/meilisearch/meilisearch-js
// Definitions by: cvermand <charlotte@meilisearch.com> <https://github.com/meilisearch>
// Definitions: https://github.com/meilisearch/meilisearch-js
// TypeScript Version: ^4.9.5
// TypeScript Version: ^5.3.3

@@ -7,0 +7,0 @@ export * from './types';

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

import { Config, SearchResponse, SearchParams, IndexObject, IndexOptions, IndexStats, DocumentsQuery, DocumentQuery, DocumentOptions, Settings, Synonyms, StopWords, RankingRules, DistinctAttribute, FilterableAttributes, SortableAttributes, SearchableAttributes, DisplayedAttributes, TypoTolerance, WaitOptions, TasksQuery, TasksResults, PaginationSettings, Faceting, ResourceResults, RawDocumentAdditionOptions, ContentType, DocumentsIds, DocumentsDeletionQuery, SearchForFacetValuesParams, SearchForFacetValuesResponse, SeparatorTokens, NonSeparatorTokens, Dictionary, ProximityPrecision, Embedders } from './types';
import { Config, SearchResponse, SearchParams, IndexObject, IndexOptions, IndexStats, DocumentsQuery, DocumentQuery, DocumentOptions, Settings, Synonyms, StopWords, RankingRules, DistinctAttribute, FilterableAttributes, SortableAttributes, SearchableAttributes, DisplayedAttributes, TypoTolerance, WaitOptions, TasksQuery, TasksResults, PaginationSettings, Faceting, ResourceResults, RawDocumentAdditionOptions, ContentType, DocumentsIds, DocumentsDeletionQuery, SearchForFacetValuesParams, SearchForFacetValuesResponse, SeparatorTokens, NonSeparatorTokens, Dictionary, ProximityPrecision, Embedders, SearchCutoffMs } from './types';
import { HttpRequests } from './http-requests';

@@ -547,4 +547,23 @@ import { Task, TaskClient } from './task';

resetEmbedders(): Promise<EnqueuedTask>;
/**
* Get the SearchCutoffMs settings.
*
* @returns Promise containing object of SearchCutoffMs settings
*/
getSearchCutoffMs(): Promise<SearchCutoffMs>;
/**
* Update the SearchCutoffMs settings.
*
* @param searchCutoffMs - Object containing SearchCutoffMsSettings
* @returns Promise containing an EnqueuedTask
*/
updateSearchCutoffMs(searchCutoffMs: SearchCutoffMs): Promise<EnqueuedTask>;
/**
* Reset the SearchCutoffMs settings.
*
* @returns Promise containing an EnqueuedTask
*/
resetSearchCutoffMs(): Promise<EnqueuedTask>;
}
export { Index };
//# sourceMappingURL=indexes.d.ts.map

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

export declare const PACKAGE_VERSION = "0.38.0";
export declare const PACKAGE_VERSION = "0.39.0";
//# sourceMappingURL=package-version.d.ts.map

@@ -0,0 +0,0 @@ import { Config, WaitOptions, TasksQuery, TasksResults, TaskObject, CancelTasksQuery, DeleteTasksQuery } from './types';

@@ -0,0 +0,0 @@ import { Config, TokenSearchRules, TokenOptions } from './types';

export * from './types';
//# sourceMappingURL=index.d.ts.map

@@ -34,3 +34,3 @@ import { Task } from '../task';

};
export type MatchingStrategies = typeof MatchingStrategies[keyof typeof MatchingStrategies];
export type MatchingStrategies = (typeof MatchingStrategies)[keyof typeof MatchingStrategies];
export type Filter = string | Array<string | string[]>;

@@ -159,3 +159,2 @@ export type Query = {

facetStats?: FacetStats;
vector?: number[];
} & (undefined extends S ? Partial<FinitePagination & InfinitePagination> : true extends IsFinitePagination<NonNullable<S>> ? FinitePagination : InfinitePagination);

@@ -231,2 +230,6 @@ type FinitePagination = {

export type ProximityPrecision = 'byWord' | 'byAttribute';
export type Distribution = {
mean: number;
sigma: number;
};
export type OpenAiEmbedder = {

@@ -238,2 +241,3 @@ source: 'openAi';

dimensions?: number;
distribution?: Distribution;
};

@@ -245,2 +249,3 @@ export type HuggingFaceEmbedder = {

documentTemplate?: string;
distribution?: Distribution;
};

@@ -250,4 +255,26 @@ export type UserProvidedEmbedder = {

dimensions: number;
distribution?: Distribution;
};
export type Embedder = OpenAiEmbedder | HuggingFaceEmbedder | UserProvidedEmbedder;
export type RestEmbedder = {
source: 'rest';
url: string;
apiKey?: string;
dimensions?: number;
documentTemplate?: string;
inputField?: string[] | null;
inputType?: 'text' | 'textArray';
query?: Record<string, any> | null;
pathToEmbeddings?: string[] | null;
embeddingObject?: string[] | null;
distribution?: Distribution;
};
export type OllamaEmbedder = {
source: 'ollama';
url?: string;
apiKey?: string;
model?: string;
documentTemplate?: string;
distribution?: Distribution;
};
export type Embedder = OpenAiEmbedder | HuggingFaceEmbedder | UserProvidedEmbedder | RestEmbedder | OllamaEmbedder | null;
export type Embedders = Record<string, Embedder> | null;

@@ -262,2 +289,3 @@ export type FacetOrder = 'alpha' | 'count';

};
export type SearchCutoffMs = number | null;
export type Settings = {

@@ -280,2 +308,3 @@ filterableAttributes?: FilterableAttributes;

embedders?: Embedders;
searchCutoffMs?: SearchCutoffMs;
};

@@ -289,3 +318,3 @@ export declare const TaskStatus: {

};
export type TaskStatus = typeof TaskStatus[keyof typeof TaskStatus];
export type TaskStatus = (typeof TaskStatus)[keyof typeof TaskStatus];
export declare const TaskTypes: {

@@ -304,3 +333,3 @@ readonly DOCUMENTS_ADDITION_OR_UPDATE: "documentAdditionOrUpdate";

};
export type TaskTypes = typeof TaskTypes[keyof typeof TaskTypes];
export type TaskTypes = (typeof TaskTypes)[keyof typeof TaskTypes];
export type TasksQuery = {

@@ -629,2 +658,4 @@ indexUids?: string[];

INVALID_SETTINGS_PAGINATION: string;
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_search_cutoff_ms */
INVALID_SETTINGS_SEARCH_CUTOFF_MS: string;
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_before_enqueued_at */

@@ -659,3 +690,3 @@ INVALID_TASK_BEFORE_ENQUEUED_AT: string;

};
export type ErrorStatusCode = typeof ErrorStatusCode[keyof typeof ErrorStatusCode];
export type ErrorStatusCode = (typeof ErrorStatusCode)[keyof typeof ErrorStatusCode];
export type TokenIndexRules = {

@@ -662,0 +693,0 @@ [field: string]: any;

@@ -0,0 +0,0 @@ /** Removes undefined entries from object */

{
"name": "meilisearch",
"version": "0.38.0",
"version": "0.39.0",
"description": "The Meilisearch JS client for Node.js and the browser.",

@@ -51,4 +51,6 @@ "keywords": [

"size": "node scripts/file-size ./dist/bundles/meilisearch.esm.min.js ./dist/bundles/meilisearch.umd.min.js",
"style": "yarn lint",
"style:fix": "yarn lint:fix",
"style": "yarn fmt && yarn lint",
"style:fix": "yarn fmt:fix && yarn lint:fix",
"fmt": "prettier -c ./**/*.{js,ts}",
"fmt:fix": "prettier -w ./**/*.{js,ts}",
"lint": "eslint --ext .js,.ts,.tsx .",

@@ -77,2 +79,3 @@ "lint:fix": "eslint --ext .js,.ts,.tsx --fix .",

"devDependencies": {
"@babel/core": "^7.23.6",
"@babel/preset-env": "^7.22.5",

@@ -84,16 +87,9 @@ "@rollup/plugin-babel": "^6.0.3",

"@types/jest": "^29.5.11",
"@types/prettier": "^2.2.3",
"@typescript-eslint/eslint-plugin": "2.34.0",
"@typescript-eslint/parser": "2.34.0",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"abort-controller": "^3.0.0",
"brotli-size": "^4.0.0",
"eslint": "^7.21.0",
"eslint-config-prettier": "^8.1.0",
"eslint-config-standard-with-typescript": "^17.0.0",
"eslint-plugin-import": "2",
"eslint-plugin-jest": "^27.6.1",
"eslint-plugin-node": "11",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "4",
"eslint-plugin-standard": "5",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-tsdoc": "^0.2.17",

@@ -108,4 +104,4 @@ "gzip-size": "^6.0.0",

"nodemon": "^2.0.16",
"prettier": "^2.2.1",
"prettier-plugin-jsdoc": "^0.4.2",
"prettier": "^3.2.3",
"prettier-plugin-jsdoc": "^1.3.0",
"pretty-bytes": "^5.6.0",

@@ -117,4 +113,4 @@ "rollup": "^2.79.1",

"ts-jest": "^29.1.1",
"typescript": "^4.9.5"
"typescript": "^5.3.3"
}
}

@@ -986,3 +986,3 @@ <p align="center">

⚠️ This feature is experimental. Activate the [`vectorStore` experimental feature to use it](https://www.meilisearch.com/docs/reference/api/experimental_features#configure-experimental-features)
⚠️ This feature is experimental. Activate the [`vectorStore` experimental feature to use it](https://www.meilisearch.com/docs/reference/api/experimental_features#configure-experimental-features)

@@ -1007,2 +1007,22 @@ #### [Get embedders](https://www.meilisearch.com/docs/reference/api/settings#get-embedders)

### SearchCutoffMs <!-- omit in toc -->
#### [Get SearchCutoffMs](https://www.meilisearch.com/docs/reference/api/settings#get-search-cutoff-ms)
```ts
client.index('myIndex').getSearchCutoffMs(): Promise<SearchCutoffMs>
```
#### [Update SearchCutoffMs](https://www.meilisearch.com/docs/reference/api/settings#update-search-cutoff-ms)
```ts
client.index('myIndex').updateSearchCutoffMs(searchCutoffMs: SearchCutoffMs): Promise<EnqueuedTask>
```
#### [Reset SearchCutoffMs](https://www.meilisearch.com/docs/reference/api/settings#reset-search-cutoff-ms)
```ts
client.index('myIndex').resetSearchCutoffMs(): Promise<EnqueuedTask>
```
### Keys <!-- omit in toc -->

@@ -1009,0 +1029,0 @@

@@ -43,6 +43,9 @@ import { Config, EnqueuedTaskObject } from './types'

if (Array.isArray(headers)) {
return headers.reduce((acc, headerPair) => {
acc[headerPair[0]] = headerPair[1]
return acc
}, {} as Record<string, string>)
return headers.reduce(
(acc, headerPair) => {
acc[headerPair[0]] = headerPair[1]
return acc
},
{} as Record<string, string>
)
} else if ('has' in headers) {

@@ -49,0 +52,0 @@ const clonedHeaders: Record<string, string> = {}

@@ -55,2 +55,3 @@ /*

Embedders,
SearchCutoffMs,
} from './types'

@@ -96,3 +97,3 @@ import { removeUndefinedFromObject } from './utils'

D extends Record<string, any> = T,
S extends SearchParams = SearchParams
S extends SearchParams = SearchParams,
>(

@@ -123,3 +124,3 @@ query?: string | null,

D extends Record<string, any> = T,
S extends SearchParams = SearchParams
S extends SearchParams = SearchParams,
>(

@@ -1340,4 +1341,45 @@ query?: string | null,

}
///
/// SEARCHCUTOFFMS SETTINGS
///
/**
* Get the SearchCutoffMs settings.
*
* @returns Promise containing object of SearchCutoffMs settings
*/
async getSearchCutoffMs(): Promise<SearchCutoffMs> {
const url = `indexes/${this.uid}/settings/search-cutoff-ms`
return await this.httpRequest.get<SearchCutoffMs>(url)
}
/**
* Update the SearchCutoffMs settings.
*
* @param searchCutoffMs - Object containing SearchCutoffMsSettings
* @returns Promise containing an EnqueuedTask
*/
async updateSearchCutoffMs(
searchCutoffMs: SearchCutoffMs
): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/search-cutoff-ms`
const task = await this.httpRequest.put(url, searchCutoffMs)
return new EnqueuedTask(task)
}
/**
* Reset the SearchCutoffMs settings.
*
* @returns Promise containing an EnqueuedTask
*/
async resetSearchCutoffMs(): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/search-cutoff-ms`
const task = await this.httpRequest.delete(url)
return new EnqueuedTask(task)
}
}
export { Index }

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

export const PACKAGE_VERSION = '0.38.0'
export const PACKAGE_VERSION = '0.39.0'

@@ -100,6 +100,8 @@ import { MeiliSearchTimeOutError } from './errors'

if (
!([
TaskStatus.TASK_ENQUEUED,
TaskStatus.TASK_PROCESSING,
] as readonly string[]).includes(response.status)
!(
[
TaskStatus.TASK_ENQUEUED,
TaskStatus.TASK_PROCESSING,
] as readonly string[]
).includes(response.status)
)

@@ -106,0 +108,0 @@ return response

import { Config, TokenSearchRules, TokenOptions } from './types'
import crypto from 'crypto'
import { createHmac } from 'crypto'
import { MeiliSearchError } from './errors'

@@ -19,4 +19,3 @@ import { validateUuid4 } from './utils'

function sign(apiKey: string, encodedHeader: string, encodedPayload: string) {
return crypto
.createHmac('sha256', apiKey)
return createHmac('sha256', apiKey)
.update(`${encodedHeader}.${encodedPayload}`)

@@ -23,0 +22,0 @@ .digest('base64')

@@ -27,2 +27,4 @@ // Type definitions for meilisearch

// TODO fix
// eslint-disable-next-line @typescript-eslint/ban-types
export type ResourceQuery = Pagination & {}

@@ -50,4 +52,8 @@

// TODO fix
// eslint-disable-next-line @typescript-eslint/ban-types
export type IndexesQuery = ResourceQuery & {}
// TODO fix
// eslint-disable-next-line @typescript-eslint/ban-types
export type IndexesResults<T> = ResourceResults<T> & {}

@@ -64,3 +70,4 @@

export type MatchingStrategies = typeof MatchingStrategies[keyof typeof MatchingStrategies]
export type MatchingStrategies =
(typeof MatchingStrategies)[keyof typeof MatchingStrategies]

@@ -207,3 +214,3 @@ export type Filter = string | Array<string | string[]>

T = Record<string, any>,
S extends SearchParams | undefined = undefined
S extends SearchParams | undefined = undefined,
> = {

@@ -215,8 +222,7 @@ hits: Hits<T>

facetStats?: FacetStats
vector?: number[]
} & (undefined extends S
? Partial<FinitePagination & InfinitePagination>
: true extends IsFinitePagination<NonNullable<S>>
? FinitePagination
: InfinitePagination)
? FinitePagination
: InfinitePagination)

@@ -243,4 +249,4 @@ type FinitePagination = {

: true extends B
? true
: false
? true
: false

@@ -337,2 +343,7 @@ type HasHitsPerPage<S extends SearchParams> = undefined extends S['hitsPerPage']

export type Distribution = {
mean: number
sigma: number
}
export type OpenAiEmbedder = {

@@ -344,2 +355,3 @@ source: 'openAi'

dimensions?: number
distribution?: Distribution
}

@@ -352,2 +364,3 @@

documentTemplate?: string
distribution?: Distribution
}

@@ -358,4 +371,28 @@

dimensions: number
distribution?: Distribution
}
export type RestEmbedder = {
source: 'rest'
url: string
apiKey?: string
dimensions?: number
documentTemplate?: string
inputField?: string[] | null
inputType?: 'text' | 'textArray'
query?: Record<string, any> | null
pathToEmbeddings?: string[] | null
embeddingObject?: string[] | null
distribution?: Distribution
}
export type OllamaEmbedder = {
source: 'ollama'
url?: string
apiKey?: string
model?: string
documentTemplate?: string
distribution?: Distribution
}
export type Embedder =

@@ -365,2 +402,5 @@ | OpenAiEmbedder

| UserProvidedEmbedder
| RestEmbedder
| OllamaEmbedder
| null

@@ -380,2 +420,4 @@ export type Embedders = Record<string, Embedder> | null

export type SearchCutoffMs = number | null
export type Settings = {

@@ -398,2 +440,3 @@ filterableAttributes?: FilterableAttributes

embedders?: Embedders
searchCutoffMs?: SearchCutoffMs
}

@@ -413,3 +456,3 @@

export type TaskStatus = typeof TaskStatus[keyof typeof TaskStatus]
export type TaskStatus = (typeof TaskStatus)[keyof typeof TaskStatus]

@@ -430,3 +473,3 @@ export const TaskTypes = {

export type TaskTypes = typeof TaskTypes[keyof typeof TaskTypes]
export type TaskTypes = (typeof TaskTypes)[keyof typeof TaskTypes]

@@ -448,3 +491,7 @@ export type TasksQuery = {

}
// TODO fix
// eslint-disable-next-line @typescript-eslint/ban-types
export type CancelTasksQuery = Omit<TasksQuery, 'limit' | 'from'> & {}
// TODO fix
// eslint-disable-next-line @typescript-eslint/ban-types
export type DeleteTasksQuery = Omit<TasksQuery, 'limit' | 'from'> & {}

@@ -600,4 +647,8 @@

// TODO fix
// eslint-disable-next-line @typescript-eslint/ban-types
export type KeysQuery = ResourceQuery & {}
// TODO fix
// eslint-disable-next-line @typescript-eslint/ban-types
export type KeysResults = ResourceResults<Key[]> & {}

@@ -935,2 +986,5 @@

/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_search_cutoff_ms */
INVALID_SETTINGS_SEARCH_CUTOFF_MS: 'invalid_settings_search_cutoff_ms',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_before_enqueued_at */

@@ -979,3 +1033,4 @@ INVALID_TASK_BEFORE_ENQUEUED_AT: 'invalid_task_before_enqueued_at',

export type ErrorStatusCode = typeof ErrorStatusCode[keyof typeof ErrorStatusCode]
export type ErrorStatusCode =
(typeof ErrorStatusCode)[keyof typeof ErrorStatusCode]

@@ -982,0 +1037,0 @@ export type TokenIndexRules = {

/** Removes undefined entries from object */
function removeUndefinedFromObject(obj: Record<string, any>): object {
return Object.entries(obj).reduce((acc, curEntry) => {
const [key, val] = curEntry
if (val !== undefined) acc[key] = val
return acc
}, {} as Record<string, any>)
return Object.entries(obj).reduce(
(acc, curEntry) => {
const [key, val] = curEntry
if (val !== undefined) acc[key] = val
return acc
},
{} as Record<string, any>
)
}

@@ -29,3 +32,4 @@

function validateUuid4(uuid: string): boolean {
const regexExp = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi
const regexExp =
/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi
return regexExp.test(uuid)

@@ -32,0 +36,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc