@meilisearch/instant-meilisearch
Version:
The search client to use Meilisearch with InstantSearch.
931 lines (917 loc) • 273 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('cross-fetch/polyfill')) :
typeof define === 'function' && define.amd ? define(['exports', 'cross-fetch/polyfill'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.window = global.window || {}));
}(this, (function (exports) { 'use strict';
/******************************************************************************
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.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function createCommonjsModule(fn) {
var module = { exports: {} };
return fn(module, module.exports), module.exports;
}
var meilisearch_umd = createCommonjsModule(function (module, exports) {
(function (global, factory) {
factory(exports) ;
})(commonjsGlobal, function (exports) {
// Type definitions for meilisearch
// Project: https://github.com/meilisearch/meilisearch-js
// Definitions by: qdequele <quentin@meilisearch.com> <https://github.com/meilisearch>
// Definitions: https://github.com/meilisearch/meilisearch-js
// TypeScript Version: ^3.8.3
/*
* SEARCH PARAMETERS
*/
var MatchingStrategies = {
ALL: 'all',
LAST: 'last'
};
var ContentTypeEnum = {
JSON: 'application/json',
CSV: 'text/csv',
NDJSON: 'application/x-ndjson'
};
/*
** TASKS
*/
var TaskStatus = {
TASK_SUCCEEDED: 'succeeded',
TASK_PROCESSING: 'processing',
TASK_FAILED: 'failed',
TASK_ENQUEUED: 'enqueued',
TASK_CANCELED: 'canceled'
};
var TaskTypes = {
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'
};
var ErrorStatusCode = {
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#index_creation_failed */
INDEX_CREATION_FAILED: 'index_creation_failed',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_index_uid */
MISSING_INDEX_UID: 'missing_index_uid',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#index_already_exists */
INDEX_ALREADY_EXISTS: 'index_already_exists',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#index_not_found */
INDEX_NOT_FOUND: 'index_not_found',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_index_uid */
INVALID_INDEX_UID: 'invalid_index_uid',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#index_not_accessible */
INDEX_NOT_ACCESSIBLE: 'index_not_accessible',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_index_offset */
INVALID_INDEX_OFFSET: 'invalid_index_offset',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_index_limit */
INVALID_INDEX_LIMIT: 'invalid_index_limit',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_state */
INVALID_STATE: 'invalid_state',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#primary_key_inference_failed */
PRIMARY_KEY_INFERENCE_FAILED: 'primary_key_inference_failed',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#index_primary_key_already_exists */
INDEX_PRIMARY_KEY_ALREADY_EXISTS: 'index_primary_key_already_exists',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_index_primary_key */
INVALID_INDEX_PRIMARY_KEY: 'invalid_index_primary_key',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#max_fields_limit_exceeded */
DOCUMENTS_FIELDS_LIMIT_REACHED: 'document_fields_limit_reached',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_document_id */
MISSING_DOCUMENT_ID: 'missing_document_id',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_document_id */
INVALID_DOCUMENT_ID: 'invalid_document_id',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_content_type */
INVALID_CONTENT_TYPE: 'invalid_content_type',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_content_type */
MISSING_CONTENT_TYPE: 'missing_content_type',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_document_fields */
INVALID_DOCUMENT_FIELDS: 'invalid_document_fields',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_document_limit */
INVALID_DOCUMENT_LIMIT: 'invalid_document_limit',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_document_offset */
INVALID_DOCUMENT_OFFSET: 'invalid_document_offset',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_document_filter */
INVALID_DOCUMENT_FILTER: 'invalid_document_filter',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_document_filter */
MISSING_DOCUMENT_FILTER: 'missing_document_filter',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_document_vectors_field */
INVALID_DOCUMENT_VECTORS_FIELD: 'invalid_document_vectors_field',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#payload_too_large */
PAYLOAD_TOO_LARGE: 'payload_too_large',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_payload */
MISSING_PAYLOAD: 'missing_payload',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#malformed_payload */
MALFORMED_PAYLOAD: 'malformed_payload',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#no_space_left_on_device */
NO_SPACE_LEFT_ON_DEVICE: 'no_space_left_on_device',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_store_file */
INVALID_STORE_FILE: 'invalid_store_file',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_ranking_rules */
INVALID_RANKING_RULES: 'missing_document_id',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_request */
INVALID_REQUEST: 'invalid_request',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_document_geo_field */
INVALID_DOCUMENT_GEO_FIELD: 'invalid_document_geo_field',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_q */
INVALID_SEARCH_Q: 'invalid_search_q',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_offset */
INVALID_SEARCH_OFFSET: 'invalid_search_offset',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_limit */
INVALID_SEARCH_LIMIT: 'invalid_search_limit',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_page */
INVALID_SEARCH_PAGE: 'invalid_search_page',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_hits_per_page */
INVALID_SEARCH_HITS_PER_PAGE: 'invalid_search_hits_per_page',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_attributes_to_retrieve */
INVALID_SEARCH_ATTRIBUTES_TO_RETRIEVE: 'invalid_search_attributes_to_retrieve',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_attributes_to_crop */
INVALID_SEARCH_ATTRIBUTES_TO_CROP: 'invalid_search_attributes_to_crop',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_crop_length */
INVALID_SEARCH_CROP_LENGTH: 'invalid_search_crop_length',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_attributes_to_highlight */
INVALID_SEARCH_ATTRIBUTES_TO_HIGHLIGHT: 'invalid_search_attributes_to_highlight',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_show_matches_position */
INVALID_SEARCH_SHOW_MATCHES_POSITION: 'invalid_search_show_matches_position',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_filter */
INVALID_SEARCH_FILTER: 'invalid_search_filter',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_sort */
INVALID_SEARCH_SORT: 'invalid_search_sort',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_facets */
INVALID_SEARCH_FACETS: 'invalid_search_facets',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_highlight_pre_tag */
INVALID_SEARCH_HIGHLIGHT_PRE_TAG: 'invalid_search_highlight_pre_tag',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_highlight_post_tag */
INVALID_SEARCH_HIGHLIGHT_POST_TAG: 'invalid_search_highlight_post_tag',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_crop_marker */
INVALID_SEARCH_CROP_MARKER: 'invalid_search_crop_marker',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_matching_strategy */
INVALID_SEARCH_MATCHING_STRATEGY: 'invalid_search_matching_strategy',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_vector */
INVALID_SEARCH_VECTOR: 'invalid_search_vector',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_attributes_to_search_on */
INVALID_SEARCH_ATTRIBUTES_TO_SEARCH_ON: 'invalid_search_attributes_to_search_on',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#bad_request */
BAD_REQUEST: 'bad_request',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#document_not_found */
DOCUMENT_NOT_FOUND: 'document_not_found',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#internal */
INTERNAL: 'internal',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key */
INVALID_API_KEY: 'invalid_api_key',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key_description */
INVALID_API_KEY_DESCRIPTION: 'invalid_api_key_description',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key_actions */
INVALID_API_KEY_ACTIONS: 'invalid_api_key_actions',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key_indexes */
INVALID_API_KEY_INDEXES: 'invalid_api_key_indexes',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key_expires_at */
INVALID_API_KEY_EXPIRES_AT: 'invalid_api_key_expires_at',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#api_key_not_found */
API_KEY_NOT_FOUND: 'api_key_not_found',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_api_key_uid */
IMMUTABLE_API_KEY_UID: 'immutable_api_key_uid',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_api_key_actions */
IMMUTABLE_API_KEY_ACTIONS: 'immutable_api_key_actions',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_api_key_indexes */
IMMUTABLE_API_KEY_INDEXES: 'immutable_api_key_indexes',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_api_key_expires_at */
IMMUTABLE_API_KEY_EXPIRES_AT: 'immutable_api_key_expires_at',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_api_key_created_at */
IMMUTABLE_API_KEY_CREATED_AT: 'immutable_api_key_created_at',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_api_key_updated_at */
IMMUTABLE_API_KEY_UPDATED_AT: 'immutable_api_key_updated_at',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_authorization_header */
MISSING_AUTHORIZATION_HEADER: 'missing_authorization_header',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#unretrievable_document */
UNRETRIEVABLE_DOCUMENT: 'unretrievable_document',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#database_size_limit_reached */
MAX_DATABASE_SIZE_LIMIT_REACHED: 'database_size_limit_reached',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#task_not_found */
TASK_NOT_FOUND: 'task_not_found',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#dump_process_failed */
DUMP_PROCESS_FAILED: 'dump_process_failed',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#dump_not_found */
DUMP_NOT_FOUND: 'dump_not_found',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_swap_duplicate_index_found */
INVALID_SWAP_DUPLICATE_INDEX_FOUND: 'invalid_swap_duplicate_index_found',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_swap_indexes */
INVALID_SWAP_INDEXES: 'invalid_swap_indexes',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_swap_indexes */
MISSING_SWAP_INDEXES: 'missing_swap_indexes',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_master_key */
MISSING_MASTER_KEY: 'missing_master_key',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_types */
INVALID_TASK_TYPES: 'invalid_task_types',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_uids */
INVALID_TASK_UIDS: 'invalid_task_uids',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_statuses */
INVALID_TASK_STATUSES: 'invalid_task_statuses',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_limit */
INVALID_TASK_LIMIT: 'invalid_task_limit',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_from */
INVALID_TASK_FROM: 'invalid_task_from',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_canceled_by */
INVALID_TASK_CANCELED_BY: 'invalid_task_canceled_by',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_task_filters */
MISSING_TASK_FILTERS: 'missing_task_filters',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#too_many_open_files */
TOO_MANY_OPEN_FILES: 'too_many_open_files',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#io_error */
IO_ERROR: 'io_error',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_index_uids */
INVALID_TASK_INDEX_UIDS: 'invalid_task_index_uids',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_index_uid */
IMMUTABLE_INDEX_UID: 'immutable_index_uid',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_index_created_at */
IMMUTABLE_INDEX_CREATED_AT: 'immutable_index_created_at',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_index_updated_at */
IMMUTABLE_INDEX_UPDATED_AT: 'immutable_index_updated_at',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_displayed_attributes */
INVALID_SETTINGS_DISPLAYED_ATTRIBUTES: 'invalid_settings_displayed_attributes',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_searchable_attributes */
INVALID_SETTINGS_SEARCHABLE_ATTRIBUTES: 'invalid_settings_searchable_attributes',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_filterable_attributes */
INVALID_SETTINGS_FILTERABLE_ATTRIBUTES: 'invalid_settings_filterable_attributes',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_sortable_attributes */
INVALID_SETTINGS_SORTABLE_ATTRIBUTES: 'invalid_settings_sortable_attributes',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_ranking_rules */
INVALID_SETTINGS_RANKING_RULES: 'invalid_settings_ranking_rules',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_stop_words */
INVALID_SETTINGS_STOP_WORDS: 'invalid_settings_stop_words',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_synonyms */
INVALID_SETTINGS_SYNONYMS: 'invalid_settings_synonyms',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_distinct_attribute */
INVALID_SETTINGS_DISTINCT_ATTRIBUTE: 'invalid_settings_distinct_attribute',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_typo_tolerance */
INVALID_SETTINGS_TYPO_TOLERANCE: 'invalid_settings_typo_tolerance',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_faceting */
INVALID_SETTINGS_FACETING: 'invalid_settings_faceting',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_pagination */
INVALID_SETTINGS_PAGINATION: 'invalid_settings_pagination',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_before_enqueued_at */
INVALID_TASK_BEFORE_ENQUEUED_AT: 'invalid_task_before_enqueued_at',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_after_enqueued_at */
INVALID_TASK_AFTER_ENQUEUED_AT: 'invalid_task_after_enqueued_at',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_before_started_at */
INVALID_TASK_BEFORE_STARTED_AT: 'invalid_task_before_started_at',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_after_started_at */
INVALID_TASK_AFTER_STARTED_AT: 'invalid_task_after_started_at',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_before_finished_at */
INVALID_TASK_BEFORE_FINISHED_AT: 'invalid_task_before_finished_at',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_after_finished_at */
INVALID_TASK_AFTER_FINISHED_AT: 'invalid_task_after_finished_at',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_api_key_actions */
MISSING_API_KEY_ACTIONS: 'missing_api_key_actions',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_api_key_indexes */
MISSING_API_KEY_INDEXES: 'missing_api_key_indexes',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_api_key_expires_at */
MISSING_API_KEY_EXPIRES_AT: 'missing_api_key_expires_at',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key_limit */
INVALID_API_KEY_LIMIT: 'invalid_api_key_limit',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key_offset */
INVALID_API_KEY_OFFSET: 'invalid_api_key_offset',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_facet_search_facet_name */
INVALID_FACET_SEARCH_FACET_NAME: 'invalid_facet_search_facet_name',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_facet_search_facet_name */
MISSING_FACET_SEARCH_FACET_NAME: 'missing_facet_search_facet_name',
/** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_facet_search_facet_query */
INVALID_FACET_SEARCH_FACET_QUERY: 'invalid_facet_search_facet_query'
};
function _iterableToArrayLimit(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e,
n,
i,
u,
a = [],
f = !0,
o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _regeneratorRuntime() {
_regeneratorRuntime = function () {
return e;
};
var t,
e = {},
r = Object.prototype,
n = r.hasOwnProperty,
o = Object.defineProperty || function (t, e, r) {
t[e] = r.value;
},
i = "function" == typeof Symbol ? Symbol : {},
a = i.iterator || "@@iterator",
c = i.asyncIterator || "@@asyncIterator",
u = i.toStringTag || "@@toStringTag";
function define(t, e, r) {
return Object.defineProperty(t, e, {
value: r,
enumerable: !0,
configurable: !0,
writable: !0
}), t[e];
}
try {
define({}, "");
} catch (t) {
define = function (t, e, r) {
return t[e] = r;
};
}
function wrap(t, e, r, n) {
var i = e && e.prototype instanceof Generator ? e : Generator,
a = Object.create(i.prototype),
c = new Context(n || []);
return o(a, "_invoke", {
value: makeInvokeMethod(t, r, c)
}), a;
}
function tryCatch(t, e, r) {
try {
return {
type: "normal",
arg: t.call(e, r)
};
} catch (t) {
return {
type: "throw",
arg: t
};
}
}
e.wrap = wrap;
var h = "suspendedStart",
l = "suspendedYield",
f = "executing",
s = "completed",
y = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
var p = {};
define(p, a, function () {
return this;
});
var d = Object.getPrototypeOf,
v = d && d(d(values([])));
v && v !== r && n.call(v, a) && (p = v);
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
function defineIteratorMethods(t) {
["next", "throw", "return"].forEach(function (e) {
define(t, e, function (t) {
return this._invoke(e, t);
});
});
}
function AsyncIterator(t, e) {
function invoke(r, o, i, a) {
var c = tryCatch(t[r], t, o);
if ("throw" !== c.type) {
var u = c.arg,
h = u.value;
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
invoke("next", t, i, a);
}, function (t) {
invoke("throw", t, i, a);
}) : e.resolve(h).then(function (t) {
u.value = t, i(u);
}, function (t) {
return invoke("throw", t, i, a);
});
}
a(c.arg);
}
var r;
o(this, "_invoke", {
value: function (t, n) {
function callInvokeWithMethodAndArg() {
return new e(function (e, r) {
invoke(t, n, e, r);
});
}
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
}
});
}
function makeInvokeMethod(e, r, n) {
var o = h;
return function (i, a) {
if (o === f) throw new Error("Generator is already running");
if (o === s) {
if ("throw" === i) throw a;
return {
value: t,
done: !0
};
}
for (n.method = i, n.arg = a;;) {
var c = n.delegate;
if (c) {
var u = maybeInvokeDelegate(c, n);
if (u) {
if (u === y) continue;
return u;
}
}
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
if (o === h) throw o = s, n.arg;
n.dispatchException(n.arg);
} else "return" === n.method && n.abrupt("return", n.arg);
o = f;
var p = tryCatch(e, r, n);
if ("normal" === p.type) {
if (o = n.done ? s : l, p.arg === y) continue;
return {
value: p.arg,
done: n.done
};
}
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
}
};
}
function maybeInvokeDelegate(e, r) {
var n = r.method,
o = e.iterator[n];
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
var i = tryCatch(o, e.iterator, r.arg);
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
var a = i.arg;
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
}
function pushTryEntry(t) {
var e = {
tryLoc: t[0]
};
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
}
function resetTryEntry(t) {
var e = t.completion || {};
e.type = "normal", delete e.arg, t.completion = e;
}
function Context(t) {
this.tryEntries = [{
tryLoc: "root"
}], t.forEach(pushTryEntry, this), this.reset(!0);
}
function values(e) {
if (e || "" === e) {
var r = e[a];
if (r) return r.call(e);
if ("function" == typeof e.next) return e;
if (!isNaN(e.length)) {
var o = -1,
i = function next() {
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
return next.value = t, next.done = !0, next;
};
return i.next = i;
}
}
throw new TypeError(typeof e + " is not iterable");
}
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
value: GeneratorFunctionPrototype,
configurable: !0
}), o(GeneratorFunctionPrototype, "constructor", {
value: GeneratorFunction,
configurable: !0
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
var e = "function" == typeof t && t.constructor;
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
}, e.mark = function (t) {
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
}, e.awrap = function (t) {
return {
__await: t
};
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
return this;
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
void 0 === i && (i = Promise);
var a = new AsyncIterator(wrap(t, r, n, o), i);
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
return t.done ? t.value : a.next();
});
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
return this;
}), define(g, "toString", function () {
return "[object Generator]";
}), e.keys = function (t) {
var e = Object(t),
r = [];
for (var n in e) r.push(n);
return r.reverse(), function next() {
for (; r.length;) {
var t = r.pop();
if (t in e) return next.value = t, next.done = !1, next;
}
return next.done = !0, next;
};
}, e.values = values, Context.prototype = {
constructor: Context,
reset: function (e) {
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
},
stop: function () {
this.done = !0;
var t = this.tryEntries[0].completion;
if ("throw" === t.type) throw t.arg;
return this.rval;
},
dispatchException: function (e) {
if (this.done) throw e;
var r = this;
function handle(n, o) {
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
}
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
var i = this.tryEntries[o],
a = i.completion;
if ("root" === i.tryLoc) return handle("end");
if (i.tryLoc <= this.prev) {
var c = n.call(i, "catchLoc"),
u = n.call(i, "finallyLoc");
if (c && u) {
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
} else if (c) {
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
} else {
if (!u) throw new Error("try statement without catch or finally");
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
}
}
}
},
abrupt: function (t, e) {
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
var o = this.tryEntries[r];
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
var i = o;
break;
}
}
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
var a = i ? i.completion : {};
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
},
complete: function (t, e) {
if ("throw" === t.type) throw t.arg;
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
},
finish: function (t) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var r = this.tryEntries[e];
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
}
},
catch: function (t) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var r = this.tryEntries[e];
if (r.tryLoc === t) {
var n = r.completion;
if ("throw" === n.type) {
var o = n.arg;
resetTryEntry(r);
}
return o;
}
}
throw new Error("illegal catch attempt");
},
delegateYield: function (e, r, n) {
return this.delegate = {
iterator: values(e),
resultName: r,
nextLoc: n
}, "next" === this.method && (this.arg = t), y;
}
}, e;
}
function _toPrimitive(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == typeof i ? i : String(i);
}
function _typeof(o) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof(o);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
return true;
} catch (e) {
return false;
}
}
function _construct(Parent, args, Class) {
if (_isNativeReflectConstruct()) {
_construct = Reflect.construct.bind();
} else {
_construct = function _construct(Parent, args, Class) {
var a = [null];
a.push.apply(a, args);
var Constructor = Function.bind.apply(Parent, a);
var instance = new Constructor();
if (Class) _setPrototypeOf(instance, Class.prototype);
return instance;
};
}
return _construct.apply(null, arguments);
}
function _isNativeFunction(fn) {
try {
return Function.toString.call(fn).indexOf("[native code]") !== -1;
} catch (e) {
return typeof fn === "function";
}
}
function _wrapNativeSuper(Class) {
var _cache = typeof Map === "function" ? new Map() : undefined;
_wrapNativeSuper = function _wrapNativeSuper(Class) {
if (Class === null || !_isNativeFunction(Class)) return Class;
if (typeof Class !== "function") {
throw new TypeError("Super expression must either be null or a function");
}
if (typeof _cache !== "undefined") {
if (_cache.has(Class)) return _cache.get(Class);
_cache.set(Class, Wrapper);
}
function Wrapper() {
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
}
Wrapper.prototype = Object.create(Class.prototype, {
constructor: {
value: Wrapper,
enumerable: false,
writable: true,
configurable: true
}
});
return _setPrototypeOf(Wrapper, Class);
};
return _wrapNativeSuper(Class);
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
} else if (call !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _createForOfIteratorHelper(o, allowArrayLike) {
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
if (!it) {
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
if (it) o = it;
var i = 0;
var F = function () {};
return {
s: F,
n: function () {
if (i >= o.length) return {
done: true
};
return {
done: false,
value: o[i++]
};
},
e: function (e) {
throw e;
},
f: F
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
var normalCompletion = true,
didErr = false,
err;
return {
s: function () {
it = it.call(o);
},
n: function () {
var step = it.next();
normalCompletion = step.done;
return step;
},