{"version":3,"file":"index.cjs","sources":["../../src/types/types.ts","../../src/errors/meilisearch-error.ts","../../src/errors/meilisearch-api-error.ts","../../src/errors/meilisearch-request-error.ts","../../src/errors/meilisearch-request-timeout-error.ts","../../src/errors/meilisearch-task-timeout-error.ts","../../src/utils.ts","../../src/http-requests.ts","../../src/task.ts","../../src/indexes.ts","../../src/batch.ts","../../src/chat-workspace.ts","../../src/meilisearch.ts","../../src/index.ts"],"sourcesContent":["// Type definitions for meilisearch\n// Project: https://github.com/meilisearch/meilisearch-js\n// Definitions by: qdequele <quentin@meilisearch.com> <https://github.com/meilisearch>\n// Definitions: https://github.com/meilisearch/meilisearch-js\n// TypeScript Version: ^5.8.2\n\nimport type { WaitOptions } from \"./task-and-batch.js\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type RecordAny = Record<string, any>;\n\n/**\n * Shape of allowed record object that can be appended to a\n * {@link URLSearchParams}.\n */\nexport type URLSearchParamsRecord = Record<\n  string,\n  | string\n  | string[]\n  | (string | string[])[]\n  | number\n  | number[]\n  | boolean\n  | Date\n  | null\n  | undefined\n>;\n\n/**\n * {@link RequestInit} without {@link RequestInit.body} and\n * {@link RequestInit.method} properties.\n */\nexport type ExtraRequestInit = Omit<RequestInit, \"body\" | \"method\">;\n\n/** Same as {@link ExtraRequestInit} but without {@link ExtraRequestInit.signal}. */\nexport type BaseRequestInit = Omit<ExtraRequestInit, \"signal\">;\n\n/**\n * Same as {@link BaseRequestInit} but with its headers property forced as a\n * {@link Headers} object.\n */\nexport type HttpRequestsRequestInit = Omit<BaseRequestInit, \"headers\"> & {\n  headers: Headers;\n};\n\n/** Main configuration object for the meilisearch client. */\nexport type Config = {\n  /**\n   * The base URL for reaching a meilisearch instance.\n   *\n   * @remarks\n   * Protocol and trailing slash can be omitted.\n   */\n  host: string;\n  /**\n   * API key for interacting with a meilisearch instance.\n   *\n   * @see {@link https://www.meilisearch.com/docs/learn/security/basic_security}\n   */\n  apiKey?: string;\n  /**\n   * Custom strings that will be concatted to the \"X-Meilisearch-Client\" header\n   * on each request.\n   */\n  clientAgents?: string[];\n  /** Base request options that may override the default ones. */\n  requestInit?: BaseRequestInit;\n  /**\n   * Custom function that can be provided in place of {@link fetch}.\n   *\n   * @remarks\n   * API response errors will have to be handled manually with this as well.\n   * @deprecated This will be removed in a future version. See\n   *   {@link https://github.com/meilisearch/meilisearch-js/issues/1824 | issue}.\n   */\n  httpClient?: (...args: Parameters<typeof fetch>) => Promise<unknown>;\n  /** Timeout in milliseconds for each HTTP request. */\n  timeout?: number;\n  /** Customizable default options for awaiting tasks. */\n  defaultWaitOptions?: WaitOptions;\n};\n\n/** Main options of a request. */\nexport type MainRequestOptions = {\n  /** The path or subpath of the URL to make a request to. */\n  path: string;\n  /** The REST method of the request. */\n  method?: string;\n  /** The search parameters of the URL. */\n  params?: URLSearchParamsRecord;\n  /**\n   * {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type | Content-Type}\n   * passed to request {@link Headers}.\n   */\n  contentType?: string;\n  /**\n   * The body of the request.\n   *\n   * @remarks\n   * This only really supports string for now (any other type gets stringified)\n   * but it could support more in the future.\n   * {@link https://developer.mozilla.org/en-US/docs/Web/API/RequestInit#body}\n   */\n  body?: string | boolean | number | object | null;\n  /**\n   * An extra, more limited {@link RequestInit}, that may override some of the\n   * options.\n   */\n  extraRequestInit?: ExtraRequestInit;\n};\n\n/**\n * {@link MainRequestOptions} without {@link MainRequestOptions.method}, for\n * method functions.\n */\nexport type RequestOptions = Omit<MainRequestOptions, \"method\">;\n\n///\n/// Resources\n///\n\nexport type Pagination = {\n  offset?: number;\n  limit?: number;\n};\n\nexport type ResourceQuery = Pagination & {};\n\nexport type ResourceResults<T> = Pagination & {\n  results: T;\n  total: number;\n};\n\nexport type ResultsWrapper<T> = {\n  results: T;\n};\n\n///\n/// Indexes\n///\n\nexport type IndexOptions = {\n  primaryKey?: string;\n};\n\nexport type IndexObject = {\n  uid: string;\n  primaryKey?: string;\n  createdAt: string;\n  updatedAt: string;\n};\n\nexport type IndexesQuery = ResourceQuery & {};\n\nexport type IndexesResults<T> = ResourceResults<T> & {};\n\n/*\n * SEARCH PARAMETERS\n */\n\nexport const MatchingStrategies = {\n  ALL: \"all\",\n  LAST: \"last\",\n  FREQUENCY: \"frequency\",\n} as const;\n\nexport type MatchingStrategies =\n  (typeof MatchingStrategies)[keyof typeof MatchingStrategies];\n\nexport type Filter = string | (string | string[])[];\n\nexport type Query = {\n  q?: string | null;\n};\n\nexport type Highlight = {\n  attributesToHighlight?: string[];\n  highlightPreTag?: string;\n  highlightPostTag?: string;\n};\n\nexport type Crop = {\n  attributesToCrop?: string[];\n  cropLength?: number;\n  cropMarker?: string;\n};\n\n// `facetName` becomes mandatory when using `searchForFacetValues`\nexport type SearchForFacetValuesParams = Omit<SearchParams, \"facetName\"> & {\n  facetName: string;\n  /**\n   * If true, the facet search will return the exhaustive count of the facet\n   * values.\n   */\n  exhaustiveFacetCount?: boolean;\n};\n\nexport type FacetHit = {\n  value: string;\n  count: number;\n};\n\nexport type SearchForFacetValuesResponse = {\n  facetHits: FacetHit[];\n  facetQuery: string | null;\n  processingTimeMs: number;\n};\n\nexport type HybridSearch = {\n  embedder: string;\n  semanticRatio?: number;\n};\n\n/**\n * Search request media binary data with explicit MIME\n *\n * @example\n *\n * ```typescript\n * const media: MediaBinary = {\n *   mime: \"image/jpeg\",\n *   data: \"base64-encoded-data\",\n * };\n * ```\n */\nexport type MediaBinary = {\n  /** MIME type of the file */\n  mime: string;\n  /** Base64-encoded data of the file */\n  data: string;\n};\n\n/** Search request media payload with named search fragments */\nexport type MediaPayload = Record<string, Record<string, string | MediaBinary>>;\n\n// https://www.meilisearch.com/docs/reference/api/settings#localized-attributes\nexport type Locale = string;\n\nexport type SearchParams = Query &\n  Pagination &\n  Highlight &\n  Crop & {\n    filter?: Filter;\n    sort?: string[];\n    facets?: string[];\n    attributesToRetrieve?: string[];\n    showMatchesPosition?: boolean;\n    matchingStrategy?: MatchingStrategies;\n    hitsPerPage?: number;\n    page?: number;\n    facetName?: string;\n    facetQuery?: string;\n    vector?: number[] | null;\n    showRankingScore?: boolean;\n    showRankingScoreDetails?: boolean;\n    rankingScoreThreshold?: number;\n    attributesToSearchOn?: string[] | null;\n    hybrid?: HybridSearch;\n    distinct?: string;\n    retrieveVectors?: boolean;\n    locales?: Locale[];\n    media?: MediaPayload;\n  };\n\n// Search parameters for searches made with the GET method\n// Are different than the parameters for the POST method\nexport type SearchRequestGET = Pagination &\n  Query &\n  Omit<Highlight, \"attributesToHighlight\"> &\n  Omit<Crop, \"attributesToCrop\"> & {\n    filter?: string;\n    sort?: string;\n    facets?: string;\n    attributesToRetrieve?: string;\n    attributesToHighlight?: string;\n    attributesToCrop?: string;\n    showMatchesPosition?: boolean;\n    vector?: string | null;\n    attributesToSearchOn?: string | null;\n    hybridEmbedder?: string;\n    hybridSemanticRatio?: number;\n    rankingScoreThreshold?: number;\n    distinct?: string;\n    retrieveVectors?: boolean;\n    locales?: Locale[];\n  };\n\nexport type MergeFacets = {\n  maxValuesPerFacet?: number | null;\n};\n\nexport type FederationOptions = { weight: number; remote?: string };\nexport type MultiSearchFederation = {\n  limit?: number;\n  offset?: number;\n  facetsByIndex?: Record<string, string[]>;\n  mergeFacets?: MergeFacets | null;\n};\n\nexport type MultiSearchQuery = SearchParams & { indexUid: string };\nexport type MultiSearchQueryWithFederation = MultiSearchQuery & {\n  federationOptions?: FederationOptions;\n};\n\nexport type MultiSearchParams = {\n  queries: MultiSearchQuery[];\n};\nexport type FederatedMultiSearchParams = {\n  federation: MultiSearchFederation;\n  queries: MultiSearchQueryWithFederation[];\n};\n\nexport type CategoriesDistribution = {\n  [category: string]: number;\n};\n\nexport type Facet = string;\nexport type FacetDistribution = Record<Facet, CategoriesDistribution>;\nexport type MatchesPosition<T> = Partial<\n  Record<keyof T, { start: number; length: number; indices?: number[] }[]>\n>;\n\nexport type RankingScoreDetails = {\n  words?: {\n    order: number;\n    matchingWords: number;\n    maxMatchingWords: number;\n    score: number;\n  };\n  typo?: {\n    order: number;\n    typoCount: number;\n    maxTypoCount: number;\n    score: number;\n  };\n  proximity?: {\n    order: number;\n    score: number;\n  };\n  attribute?: {\n    order: number;\n    attributes_ranking_order: number;\n    attributes_query_word_order: number;\n    score: number;\n  };\n  exactness?: {\n    order: number;\n    matchType: string;\n    score: number;\n  };\n  [key: string]: RecordAny | undefined;\n};\n\nexport type FederationDetails = {\n  indexUid: string;\n  queriesPosition: number;\n  weightedRankingScore: number;\n};\n\nexport type Hit<T = RecordAny> = T & {\n  _formatted?: Partial<T>;\n  _matchesPosition?: MatchesPosition<T>;\n  _rankingScore?: number;\n  _rankingScoreDetails?: RankingScoreDetails;\n  _federation?: FederationDetails;\n};\n\nexport type Hits<T = RecordAny> = Hit<T>[];\n\nexport type FacetStat = { min: number; max: number };\nexport type FacetStats = Record<string, FacetStat>;\n\nexport type FacetsByIndex = Record<\n  string,\n  {\n    distribution: FacetDistribution;\n    stats: FacetStats;\n  }\n>;\n\nexport type SearchResponse<\n  T = RecordAny,\n  S extends SearchParams | undefined = undefined,\n> = {\n  hits: Hits<T>;\n  processingTimeMs: number;\n  query: string;\n  facetDistribution?: FacetDistribution;\n  facetStats?: FacetStats;\n  facetsByIndex?: FacetsByIndex;\n} & (undefined extends S\n  ? Partial<FinitePagination & InfinitePagination>\n  : true extends IsFinitePagination<NonNullable<S>>\n    ? FinitePagination\n    : InfinitePagination);\n\ntype FinitePagination = {\n  totalHits: number;\n  hitsPerPage: number;\n  page: number;\n  totalPages: number;\n};\ntype InfinitePagination = {\n  offset: number;\n  limit: number;\n  estimatedTotalHits: number;\n};\n\ntype IsFinitePagination<S extends SearchParams> = Or<\n  HasHitsPerPage<S>,\n  HasPage<S>\n>;\n\ntype Or<A extends boolean, B extends boolean> = true extends A\n  ? true\n  : true extends B\n    ? true\n    : false;\n\ntype HasHitsPerPage<S extends SearchParams> = undefined extends S[\"hitsPerPage\"]\n  ? false\n  : true;\n\ntype HasPage<S extends SearchParams> = undefined extends S[\"page\"]\n  ? false\n  : true;\n\nexport type MultiSearchResult<T> = SearchResponse<T> & { indexUid: string };\n\nexport type MultiSearchResponse<T = RecordAny> = {\n  results: MultiSearchResult<T>[];\n};\n\nexport type MultiSearchResponseOrSearchResponse<\n  T1 extends FederatedMultiSearchParams | MultiSearchParams,\n  T2 extends RecordAny = RecordAny,\n> = T1 extends FederatedMultiSearchParams\n  ? SearchResponse<T2>\n  : MultiSearchResponse<T2>;\n\nexport type FieldDistribution = {\n  [field: string]: number;\n};\n\nexport type SearchSimilarDocumentsParams = {\n  id: string | number;\n  offset?: number;\n  limit?: number;\n  filter?: Filter;\n  embedder?: string;\n  attributesToRetrieve?: string[];\n  showRankingScore?: boolean;\n  showRankingScoreDetails?: boolean;\n  rankingScoreThreshold?: number;\n};\n\n/*\n ** Documents\n */\n\ntype Fields<T = RecordAny> =\n  | Extract<keyof T, string>[]\n  | Extract<keyof T, string>;\n\nexport type DocumentOptions = {\n  primaryKey?: string;\n};\n\nexport const ContentTypeEnum: Readonly<Record<string, ContentType>> = {\n  JSON: \"application/json\",\n  CSV: \"text/csv\",\n  NDJSON: \"application/x-ndjson\",\n};\n\nexport type ContentType =\n  | \"text/csv\"\n  | \"application/x-ndjson\"\n  | \"application/json\";\n\nexport type RawDocumentAdditionOptions = DocumentOptions & {\n  csvDelimiter?: string;\n};\n\nexport type DocumentsQuery<T = RecordAny> = ResourceQuery & {\n  ids?: string[] | number[];\n  fields?: Fields<T>;\n  filter?: Filter;\n  limit?: number;\n  offset?: number;\n  retrieveVectors?: boolean;\n};\n\nexport type DocumentQuery<T = RecordAny> = {\n  fields?: Fields<T>;\n};\n\nexport type DocumentsDeletionQuery = {\n  filter: Filter;\n};\n\nexport type DocumentsIds = string[] | number[];\n\nexport type UpdateDocumentsByFunctionOptions = {\n  function: string;\n  filter?: string | string[];\n  context?: RecordAny;\n};\n\n/*\n ** Settings\n */\n\nexport type GranularFilterableAttribute = {\n  attributePatterns: string[];\n  features: {\n    facetSearch: boolean;\n    filter: { equality: boolean; comparison: boolean };\n  };\n};\n\nexport type FilterableAttributes =\n  | (string | GranularFilterableAttribute)[]\n  | null;\nexport type DistinctAttribute = string | null;\nexport type SearchableAttributes = string[] | null;\nexport type SortableAttributes = string[] | null;\nexport type DisplayedAttributes = string[] | null;\nexport type RankingRules = string[] | null;\nexport type StopWords = string[] | null;\nexport type Synonyms = Record<string, string[]> | null;\nexport type TypoTolerance = {\n  enabled?: boolean | null;\n  disableOnAttributes?: string[] | null;\n  disableOnNumbers?: boolean | null;\n  disableOnWords?: string[] | null;\n  minWordSizeForTypos?: {\n    oneTypo?: number | null;\n    twoTypos?: number | null;\n  };\n} | null;\nexport type SeparatorTokens = string[] | null;\nexport type NonSeparatorTokens = string[] | null;\nexport type Dictionary = string[] | null;\nexport type ProximityPrecision = \"byWord\" | \"byAttribute\";\n\nexport type Distribution = {\n  mean: number;\n  sigma: number;\n};\n\nexport type OpenAiEmbedder = {\n  source: \"openAi\";\n  model?: string;\n  apiKey?: string;\n  documentTemplate?: string;\n  dimensions?: number;\n  distribution?: Distribution;\n  url?: string;\n  documentTemplateMaxBytes?: number;\n  binaryQuantized?: boolean;\n};\n\nexport type HuggingFaceEmbedder = {\n  source: \"huggingFace\";\n  model?: string;\n  revision?: string;\n  documentTemplate?: string;\n  distribution?: Distribution;\n  pooling?: \"useModel\" | \"forceMean\" | \"forceCls\";\n  documentTemplateMaxBytes?: number;\n  binaryQuantized?: boolean;\n};\n\nexport type UserProvidedEmbedder = {\n  source: \"userProvided\";\n  dimensions: number;\n  distribution?: Distribution;\n  binaryQuantized?: boolean;\n};\n\n/**\n * Indexing or search fragments\n *\n * @example\n *\n * ```typescript\n * const fragments: EmbedderFragments = {\n *   textAndPoster: {\n *     value: {\n *       content: [\n *         {\n *           type: \"text\",\n *           text: \"A movie titled {{doc.title}} whose description starts with {{doc.overview|truncatewords:20}}.\",\n *         },\n *         {\n *           type: \"image_url\",\n *           image_url: \"{{doc.poster}}\",\n *         },\n *       ],\n *     },\n *   },\n * };\n * ```\n */\nexport type EmbedderFragments = Record<string, { value: RecordAny }>;\n\nexport type RestEmbedder = {\n  source: \"rest\";\n  url: string;\n  apiKey?: string;\n  dimensions?: number;\n  documentTemplate?: string;\n  distribution?: Distribution;\n  request: RecordAny;\n  response: RecordAny;\n  headers?: Record<string, string>;\n  documentTemplateMaxBytes?: number;\n  binaryQuantized?: boolean;\n  indexingFragments?: EmbedderFragments;\n  searchFragments?: EmbedderFragments;\n};\n\nexport type OllamaEmbedder = {\n  source: \"ollama\";\n  url?: string;\n  apiKey?: string;\n  model?: string;\n  documentTemplate?: string;\n  distribution?: Distribution;\n  dimensions?: number;\n  documentTemplateMaxBytes?: number;\n  binaryQuantized?: boolean;\n};\n\nexport type CompositeEmbedder = {\n  source: \"composite\";\n  searchEmbedder: Embedder;\n  indexingEmbedder: Embedder;\n};\n\nexport type Embedder =\n  | OpenAiEmbedder\n  | HuggingFaceEmbedder\n  | UserProvidedEmbedder\n  | RestEmbedder\n  | OllamaEmbedder\n  | CompositeEmbedder\n  | null;\n\nexport type Embedders = Record<string, Embedder> | null;\n\nexport type FacetOrder = \"alpha\" | \"count\";\n\nexport type Faceting = {\n  maxValuesPerFacet?: number | null;\n  sortFacetValuesBy?: Record<string, FacetOrder> | null;\n};\n\nexport type PaginationSettings = {\n  maxTotalHits?: number | null;\n};\n\nexport type SearchCutoffMs = number | null;\n\nexport type LocalizedAttribute = {\n  attributePatterns: string[];\n  locales: Locale[];\n};\n\nexport type LocalizedAttributes = LocalizedAttribute[] | null;\n\nexport type PrefixSearch = \"indexingTime\" | \"disabled\";\n\nexport type Settings = {\n  filterableAttributes?: FilterableAttributes;\n  distinctAttribute?: DistinctAttribute;\n  sortableAttributes?: SortableAttributes;\n  searchableAttributes?: SearchableAttributes;\n  displayedAttributes?: DisplayedAttributes;\n  rankingRules?: RankingRules;\n  stopWords?: StopWords;\n  synonyms?: Synonyms;\n  typoTolerance?: TypoTolerance;\n  faceting?: Faceting;\n  pagination?: PaginationSettings;\n  separatorTokens?: SeparatorTokens;\n  nonSeparatorTokens?: NonSeparatorTokens;\n  dictionary?: Dictionary;\n  proximityPrecision?: ProximityPrecision;\n  embedders?: Embedders;\n  searchCutoffMs?: SearchCutoffMs;\n  localizedAttributes?: LocalizedAttributes;\n\n  /**\n   * Enable facet searching on all the filters of an index (requires Meilisearch\n   * 1.12.0 or later)\n   */\n  facetSearch?: boolean;\n  /**\n   * Enable the ability to search a word by prefix on an index (requires\n   * Meilisearch 1.12.0 or later)\n   */\n  prefixSearch?: \"indexingTime\" | \"disabled\";\n};\n\n/*\n *** HEALTH\n */\n\nexport type Health = {\n  status: \"available\";\n};\n\n/*\n *** STATS\n */\n\nexport type IndexStats = {\n  numberOfDocuments: number;\n  isIndexing: boolean;\n  fieldDistribution: FieldDistribution;\n  numberOfEmbeddedDocuments: number;\n  numberOfEmbeddings: number;\n  rawDocumentDbSize: number;\n  avgDocumentSize: number;\n};\n\nexport type Stats = {\n  databaseSize: number;\n  usedDatabaseSize: number;\n  lastUpdate: string;\n  indexes: {\n    [index: string]: IndexStats;\n  };\n};\n\n/*\n ** CHATS\n */\n\n/** @see https://www.meilisearch.com/docs/reference/api/chats#settings-parameters */\nexport type ChatWorkspaceSettings = {\n  source: \"openAi\" | \"azureOpenAi\" | \"mistral\" | \"gemini\" | \"vLlm\";\n  orgId?: string;\n  projectId?: string;\n  apiVersion?: string;\n  deploymentId?: string;\n  baseUrl?: string;\n  apiKey: string;\n  prompts: {\n    system: string;\n  };\n};\n\nexport type ChatCompletionRequest = {\n  model: string;\n  messages: {\n    role: \"user\" | \"assistant\" | \"system\";\n    content: string;\n  }[];\n  stream: boolean;\n};\n\nexport type ChatSettings = {\n  description: string;\n  documentTemplate: string;\n  documentTemplateMaxBytes: number;\n  searchParameters: SearchParams;\n};\n\nexport type ChatSettingsPayload = {\n  description?: string;\n  documentTemplate?: string;\n  documentTemplateMaxBytes?: number;\n  searchParameters?: Partial<SearchParams>;\n};\n\n/*\n ** Keys\n */\n\nexport type Key = {\n  uid: string;\n  description: string;\n  name: string | null;\n  key: string;\n  actions: string[];\n  indexes: string[];\n  expiresAt: Date;\n  createdAt: Date;\n  updatedAt: Date;\n};\n\nexport type KeyCreation = {\n  uid?: string;\n  name?: string;\n  description?: string;\n  actions: string[];\n  indexes: string[];\n  expiresAt: Date | null;\n};\n\nexport type KeyUpdate = {\n  name?: string;\n  description?: string;\n};\n\nexport type KeysQuery = ResourceQuery & {};\n\nexport type KeysResults = ResourceResults<Key[]> & {};\n\n/*\n ** version\n */\nexport type Version = {\n  commitSha: string;\n  commitDate: string;\n  pkgVersion: string;\n};\n\n/*\n ** ERROR HANDLER\n */\n\nexport type MeiliSearchErrorResponse = {\n  message: string;\n  // https://www.meilisearch.com/docs/reference/errors/error_codes\n  code: string;\n  // https://www.meilisearch.com/docs/reference/errors/overview#errors\n  type: string;\n  link: string;\n};\n\n// @TODO: This doesn't seem to be up to date, and its usefulness comes into question.\nexport const ErrorStatusCode = {\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#index_creation_failed */\n  INDEX_CREATION_FAILED: \"index_creation_failed\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_index_uid */\n  MISSING_INDEX_UID: \"missing_index_uid\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#index_already_exists */\n  INDEX_ALREADY_EXISTS: \"index_already_exists\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#index_not_found */\n  INDEX_NOT_FOUND: \"index_not_found\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_index_uid */\n  INVALID_INDEX_UID: \"invalid_index_uid\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#index_not_accessible */\n  INDEX_NOT_ACCESSIBLE: \"index_not_accessible\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_index_offset */\n  INVALID_INDEX_OFFSET: \"invalid_index_offset\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_index_limit */\n  INVALID_INDEX_LIMIT: \"invalid_index_limit\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_state */\n  INVALID_STATE: \"invalid_state\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#primary_key_inference_failed */\n  PRIMARY_KEY_INFERENCE_FAILED: \"primary_key_inference_failed\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#index_primary_key_already_exists */\n  INDEX_PRIMARY_KEY_ALREADY_EXISTS: \"index_primary_key_already_exists\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_index_primary_key */\n  INVALID_INDEX_PRIMARY_KEY: \"invalid_index_primary_key\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#max_fields_limit_exceeded */\n  DOCUMENTS_FIELDS_LIMIT_REACHED: \"document_fields_limit_reached\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_document_id */\n  MISSING_DOCUMENT_ID: \"missing_document_id\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_document_id */\n  INVALID_DOCUMENT_ID: \"invalid_document_id\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_content_type */\n  INVALID_CONTENT_TYPE: \"invalid_content_type\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_content_type */\n  MISSING_CONTENT_TYPE: \"missing_content_type\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_document_fields */\n  INVALID_DOCUMENT_FIELDS: \"invalid_document_fields\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_document_limit */\n  INVALID_DOCUMENT_LIMIT: \"invalid_document_limit\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_document_offset */\n  INVALID_DOCUMENT_OFFSET: \"invalid_document_offset\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_document_filter */\n  INVALID_DOCUMENT_FILTER: \"invalid_document_filter\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_document_filter */\n  MISSING_DOCUMENT_FILTER: \"missing_document_filter\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_document_vectors_field */\n  INVALID_DOCUMENT_VECTORS_FIELD: \"invalid_document_vectors_field\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#payload_too_large */\n  PAYLOAD_TOO_LARGE: \"payload_too_large\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_payload */\n  MISSING_PAYLOAD: \"missing_payload\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#malformed_payload */\n  MALFORMED_PAYLOAD: \"malformed_payload\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#no_space_left_on_device */\n  NO_SPACE_LEFT_ON_DEVICE: \"no_space_left_on_device\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_store_file */\n  INVALID_STORE_FILE: \"invalid_store_file\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_ranking_rules */\n  INVALID_RANKING_RULES: \"missing_document_id\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_request */\n  INVALID_REQUEST: \"invalid_request\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_document_geo_field */\n  INVALID_DOCUMENT_GEO_FIELD: \"invalid_document_geo_field\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_q */\n  INVALID_SEARCH_Q: \"invalid_search_q\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_offset */\n  INVALID_SEARCH_OFFSET: \"invalid_search_offset\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_limit */\n  INVALID_SEARCH_LIMIT: \"invalid_search_limit\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_page */\n  INVALID_SEARCH_PAGE: \"invalid_search_page\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_hits_per_page */\n  INVALID_SEARCH_HITS_PER_PAGE: \"invalid_search_hits_per_page\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_attributes_to_retrieve */\n  INVALID_SEARCH_ATTRIBUTES_TO_RETRIEVE:\n    \"invalid_search_attributes_to_retrieve\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_attributes_to_crop */\n  INVALID_SEARCH_ATTRIBUTES_TO_CROP: \"invalid_search_attributes_to_crop\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_crop_length */\n  INVALID_SEARCH_CROP_LENGTH: \"invalid_search_crop_length\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_attributes_to_highlight */\n  INVALID_SEARCH_ATTRIBUTES_TO_HIGHLIGHT:\n    \"invalid_search_attributes_to_highlight\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_show_matches_position */\n  INVALID_SEARCH_SHOW_MATCHES_POSITION: \"invalid_search_show_matches_position\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_filter */\n  INVALID_SEARCH_FILTER: \"invalid_search_filter\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_sort */\n  INVALID_SEARCH_SORT: \"invalid_search_sort\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_facets */\n  INVALID_SEARCH_FACETS: \"invalid_search_facets\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_highlight_pre_tag */\n  INVALID_SEARCH_HIGHLIGHT_PRE_TAG: \"invalid_search_highlight_pre_tag\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_highlight_post_tag */\n  INVALID_SEARCH_HIGHLIGHT_POST_TAG: \"invalid_search_highlight_post_tag\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_crop_marker */\n  INVALID_SEARCH_CROP_MARKER: \"invalid_search_crop_marker\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_matching_strategy */\n  INVALID_SEARCH_MATCHING_STRATEGY: \"invalid_search_matching_strategy\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_vector */\n  INVALID_SEARCH_VECTOR: \"invalid_search_vector\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_attributes_to_search_on */\n  INVALID_SEARCH_ATTRIBUTES_TO_SEARCH_ON:\n    \"invalid_search_attributes_to_search_on\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#bad_request */\n  BAD_REQUEST: \"bad_request\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#document_not_found */\n  DOCUMENT_NOT_FOUND: \"document_not_found\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#internal */\n  INTERNAL: \"internal\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key */\n  INVALID_API_KEY: \"invalid_api_key\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key_description */\n  INVALID_API_KEY_DESCRIPTION: \"invalid_api_key_description\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key_actions */\n  INVALID_API_KEY_ACTIONS: \"invalid_api_key_actions\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key_indexes */\n  INVALID_API_KEY_INDEXES: \"invalid_api_key_indexes\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key_expires_at */\n  INVALID_API_KEY_EXPIRES_AT: \"invalid_api_key_expires_at\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#api_key_not_found */\n  API_KEY_NOT_FOUND: \"api_key_not_found\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_api_key_uid */\n  IMMUTABLE_API_KEY_UID: \"immutable_api_key_uid\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_api_key_actions */\n  IMMUTABLE_API_KEY_ACTIONS: \"immutable_api_key_actions\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_api_key_indexes */\n  IMMUTABLE_API_KEY_INDEXES: \"immutable_api_key_indexes\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_api_key_expires_at */\n  IMMUTABLE_API_KEY_EXPIRES_AT: \"immutable_api_key_expires_at\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_api_key_created_at */\n  IMMUTABLE_API_KEY_CREATED_AT: \"immutable_api_key_created_at\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_api_key_updated_at */\n  IMMUTABLE_API_KEY_UPDATED_AT: \"immutable_api_key_updated_at\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_authorization_header */\n  MISSING_AUTHORIZATION_HEADER: \"missing_authorization_header\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#unretrievable_document */\n  UNRETRIEVABLE_DOCUMENT: \"unretrievable_document\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#database_size_limit_reached */\n  MAX_DATABASE_SIZE_LIMIT_REACHED: \"database_size_limit_reached\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#task_not_found */\n  TASK_NOT_FOUND: \"task_not_found\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#dump_process_failed */\n  DUMP_PROCESS_FAILED: \"dump_process_failed\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#dump_not_found */\n  DUMP_NOT_FOUND: \"dump_not_found\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_swap_duplicate_index_found */\n  INVALID_SWAP_DUPLICATE_INDEX_FOUND: \"invalid_swap_duplicate_index_found\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_swap_indexes */\n  INVALID_SWAP_INDEXES: \"invalid_swap_indexes\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_swap_indexes */\n  MISSING_SWAP_INDEXES: \"missing_swap_indexes\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_master_key */\n  MISSING_MASTER_KEY: \"missing_master_key\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_types */\n  INVALID_TASK_TYPES: \"invalid_task_types\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_uids */\n  INVALID_TASK_UIDS: \"invalid_task_uids\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_statuses */\n  INVALID_TASK_STATUSES: \"invalid_task_statuses\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_limit */\n  INVALID_TASK_LIMIT: \"invalid_task_limit\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_from */\n  INVALID_TASK_FROM: \"invalid_task_from\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_canceled_by */\n  INVALID_TASK_CANCELED_BY: \"invalid_task_canceled_by\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_task_filters */\n  MISSING_TASK_FILTERS: \"missing_task_filters\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#too_many_open_files */\n  TOO_MANY_OPEN_FILES: \"too_many_open_files\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#io_error */\n  IO_ERROR: \"io_error\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_index_uids */\n  INVALID_TASK_INDEX_UIDS: \"invalid_task_index_uids\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_index_uid */\n  IMMUTABLE_INDEX_UID: \"immutable_index_uid\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_index_created_at */\n  IMMUTABLE_INDEX_CREATED_AT: \"immutable_index_created_at\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#immutable_index_updated_at */\n  IMMUTABLE_INDEX_UPDATED_AT: \"immutable_index_updated_at\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_displayed_attributes */\n  INVALID_SETTINGS_DISPLAYED_ATTRIBUTES:\n    \"invalid_settings_displayed_attributes\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_searchable_attributes */\n  INVALID_SETTINGS_SEARCHABLE_ATTRIBUTES:\n    \"invalid_settings_searchable_attributes\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_filterable_attributes */\n  INVALID_SETTINGS_FILTERABLE_ATTRIBUTES:\n    \"invalid_settings_filterable_attributes\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_sortable_attributes */\n  INVALID_SETTINGS_SORTABLE_ATTRIBUTES: \"invalid_settings_sortable_attributes\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_ranking_rules */\n  INVALID_SETTINGS_RANKING_RULES: \"invalid_settings_ranking_rules\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_stop_words */\n  INVALID_SETTINGS_STOP_WORDS: \"invalid_settings_stop_words\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_synonyms */\n  INVALID_SETTINGS_SYNONYMS: \"invalid_settings_synonyms\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_distinct_attribute */\n  INVALID_SETTINGS_DISTINCT_ATTRIBUTE: \"invalid_settings_distinct_attribute\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_typo_tolerance */\n  INVALID_SETTINGS_TYPO_TOLERANCE: \"invalid_settings_typo_tolerance\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_faceting */\n  INVALID_SETTINGS_FACETING: \"invalid_settings_faceting\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_pagination */\n  INVALID_SETTINGS_PAGINATION: \"invalid_settings_pagination\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_search_cutoff_ms */\n  INVALID_SETTINGS_SEARCH_CUTOFF_MS: \"invalid_settings_search_cutoff_ms\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_search_cutoff_ms */\n  INVALID_SETTINGS_LOCALIZED_ATTRIBUTES:\n    \"invalid_settings_localized_attributes\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_before_enqueued_at */\n  INVALID_TASK_BEFORE_ENQUEUED_AT: \"invalid_task_before_enqueued_at\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_after_enqueued_at */\n  INVALID_TASK_AFTER_ENQUEUED_AT: \"invalid_task_after_enqueued_at\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_before_started_at */\n  INVALID_TASK_BEFORE_STARTED_AT: \"invalid_task_before_started_at\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_after_started_at */\n  INVALID_TASK_AFTER_STARTED_AT: \"invalid_task_after_started_at\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_before_finished_at */\n  INVALID_TASK_BEFORE_FINISHED_AT: \"invalid_task_before_finished_at\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_after_finished_at */\n  INVALID_TASK_AFTER_FINISHED_AT: \"invalid_task_after_finished_at\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_api_key_actions */\n  MISSING_API_KEY_ACTIONS: \"missing_api_key_actions\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_api_key_indexes */\n  MISSING_API_KEY_INDEXES: \"missing_api_key_indexes\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_api_key_expires_at */\n  MISSING_API_KEY_EXPIRES_AT: \"missing_api_key_expires_at\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key_limit */\n  INVALID_API_KEY_LIMIT: \"invalid_api_key_limit\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_api_key_offset */\n  INVALID_API_KEY_OFFSET: \"invalid_api_key_offset\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_facet_search_facet_name */\n  INVALID_FACET_SEARCH_FACET_NAME: \"invalid_facet_search_facet_name\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#missing_facet_search_facet_name */\n  MISSING_FACET_SEARCH_FACET_NAME: \"missing_facet_search_facet_name\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_facet_search_facet_query */\n  INVALID_FACET_SEARCH_FACET_QUERY: \"invalid_facet_search_facet_query\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_search_ranking_score_threshold */\n  INVALID_SEARCH_RANKING_SCORE_THRESHOLD:\n    \"invalid_search_ranking_score_threshold\",\n\n  /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_similar_ranking_score_threshold */\n  INVALID_SIMILAR_RANKING_SCORE_THRESHOLD:\n    \"invalid_similar_ranking_score_threshold\",\n};\n\nexport type ErrorStatusCode =\n  (typeof ErrorStatusCode)[keyof typeof ErrorStatusCode];\n","export class MeiliSearchError extends Error {\n  override name = \"MeiliSearchError\";\n}\n","import type { MeiliSearchErrorResponse } from \"../types/index.js\";\nimport { MeiliSearchError } from \"./meilisearch-error.js\";\n\nexport class MeiliSearchApiError extends MeiliSearchError {\n  override name = \"MeiliSearchApiError\";\n  override cause?: MeiliSearchErrorResponse;\n  readonly response: Response;\n\n  constructor(response: Response, responseBody?: MeiliSearchErrorResponse) {\n    super(\n      responseBody?.message ?? `${response.status}: ${response.statusText}`,\n    );\n\n    this.response = response;\n\n    if (responseBody !== undefined) {\n      this.cause = responseBody;\n    }\n  }\n}\n","import { MeiliSearchError } from \"./meilisearch-error.js\";\n\nexport class MeiliSearchRequestError extends MeiliSearchError {\n  override name = \"MeiliSearchRequestError\";\n\n  constructor(url: string, cause: unknown) {\n    super(`Request to ${url} has failed`, { cause });\n  }\n}\n","import { MeiliSearchError } from \"./meilisearch-error.js\";\n\n/** Error thrown when a HTTP request times out. */\nexport class MeiliSearchRequestTimeOutError extends MeiliSearchError {\n  override name = \"MeiliSearchRequestTimeOutError\";\n  override cause: { timeout: number; requestInit: RequestInit };\n\n  constructor(timeout: number, requestInit: RequestInit) {\n    super(`request timed out after ${timeout}ms`);\n\n    this.cause = { timeout, requestInit };\n  }\n}\n","import { MeiliSearchError } from \"./meilisearch-error.js\";\n\n/** Error thrown when a waiting for a task times out. */\nexport class MeiliSearchTaskTimeOutError extends MeiliSearchError {\n  override name = \"MeiliSearchTaskTimeOutError\";\n  override cause: { taskUid: number; timeout: number };\n\n  constructor(taskUid: number, timeout: number) {\n    super(\n      `timeout of ${timeout}ms has exceeded on task ${taskUid} when waiting for it to be resolved.`,\n    );\n\n    this.cause = { taskUid, timeout };\n  }\n}\n","async function sleep(ms: number): Promise<void> {\n  return await new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nfunction addProtocolIfNotPresent(host: string): string {\n  if (!(host.startsWith(\"https://\") || host.startsWith(\"http://\"))) {\n    return `http://${host}`;\n  }\n  return host;\n}\n\nfunction addTrailingSlash(url: string): string {\n  if (!url.endsWith(\"/\")) {\n    url += \"/\";\n  }\n  return url;\n}\n\nexport { sleep, addProtocolIfNotPresent, addTrailingSlash };\n","import type {\n  Config,\n  HttpRequestsRequestInit,\n  RequestOptions,\n  MainRequestOptions,\n  URLSearchParamsRecord,\n  MeiliSearchErrorResponse,\n} from \"./types/index.js\";\nimport pkg from \"../package.json\" with { type: \"json\" };\nimport {\n  MeiliSearchError,\n  MeiliSearchApiError,\n  MeiliSearchRequestError,\n  MeiliSearchRequestTimeOutError,\n} from \"./errors/index.js\";\nimport { addProtocolIfNotPresent, addTrailingSlash } from \"./utils.js\";\n\n/** Append a set of key value pairs to a {@link URLSearchParams} object. */\nfunction appendRecordToURLSearchParams(\n  searchParams: URLSearchParams,\n  recordToAppend: URLSearchParamsRecord,\n): void {\n  for (const [key, val] of Object.entries(recordToAppend)) {\n    if (val != null) {\n      searchParams.set(\n        key,\n        Array.isArray(val)\n          ? val.join()\n          : val instanceof Date\n            ? val.toISOString()\n            : String(val),\n      );\n    }\n  }\n}\n\n/**\n * Creates a new Headers object from a {@link HeadersInit} and adds various\n * properties to it, some from {@link Config}.\n *\n * @returns A new Headers object\n */\nfunction getHeaders(config: Config, headersInit?: HeadersInit): Headers {\n  const agentHeader = \"X-Meilisearch-Client\";\n  const packageAgent = `Meilisearch JavaScript (v${pkg.version})`;\n  const contentType = \"Content-Type\";\n  const authorization = \"Authorization\";\n\n  const headers = new Headers(headersInit);\n\n  // do not override if user provided the header\n  if (config.apiKey && !headers.has(authorization)) {\n    headers.set(authorization, `Bearer ${config.apiKey}`);\n  }\n\n  if (!headers.has(contentType)) {\n    headers.set(contentType, \"application/json\");\n  }\n\n  // Creates the custom user agent with information on the package used.\n  if (config.clientAgents !== undefined) {\n    const clients = config.clientAgents.concat(packageAgent);\n\n    headers.set(agentHeader, clients.join(\" ; \"));\n  } else {\n    headers.set(agentHeader, packageAgent);\n  }\n\n  return headers;\n}\n\n/** Used to identify whether an error is a timeout error after fetch request. */\nconst TIMEOUT_ID = Symbol(\"<timeout>\");\n\n/**\n * Attach a timeout signal to a {@link RequestInit}, while preserving original\n * signal functionality, if there is one.\n *\n * @remarks\n * This could be a short few straight forward lines using {@link AbortSignal.any}\n * and {@link AbortSignal.timeout}, but these aren't yet widely supported enough,\n * nor polyfill -able, at the time of writing.\n * @returns A new function which starts the timeout, which then returns another\n *   function that clears the timeout\n */\nfunction getTimeoutFn(\n  requestInit: RequestInit,\n  ms: number,\n): () => (() => void) | void {\n  const { signal } = requestInit;\n  const ac = new AbortController();\n\n  if (signal != null) {\n    let acSignalFn: (() => void) | null = null;\n\n    if (signal.aborted) {\n      ac.abort(signal.reason);\n    } else {\n      const fn = () => ac.abort(signal.reason);\n\n      signal.addEventListener(\"abort\", fn, { once: true });\n\n      acSignalFn = () => signal.removeEventListener(\"abort\", fn);\n      ac.signal.addEventListener(\"abort\", acSignalFn, { once: true });\n    }\n\n    return () => {\n      if (signal.aborted) {\n        return;\n      }\n\n      const to = setTimeout(() => ac.abort(TIMEOUT_ID), ms);\n      const fn = () => {\n        clearTimeout(to);\n\n        if (acSignalFn !== null) {\n          ac.signal.removeEventListener(\"abort\", acSignalFn);\n        }\n      };\n\n      signal.addEventListener(\"abort\", fn, { once: true });\n\n      return () => {\n        signal.removeEventListener(\"abort\", fn);\n        fn();\n      };\n    };\n  }\n\n  requestInit.signal = ac.signal;\n\n  return () => {\n    const to = setTimeout(() => ac.abort(TIMEOUT_ID), ms);\n    return () => clearTimeout(to);\n  };\n}\n\n/** Class used to perform HTTP requests. */\nexport class HttpRequests {\n  #url: URL;\n  #requestInit: HttpRequestsRequestInit;\n  #customRequestFn?: Config[\"httpClient\"];\n  #requestTimeout?: Config[\"timeout\"];\n\n  constructor(config: Config) {\n    const host = addTrailingSlash(addProtocolIfNotPresent(config.host));\n\n    try {\n      this.#url = new URL(host);\n    } catch (error) {\n      throw new MeiliSearchError(\"The provided host is not valid\", {\n        cause: error,\n      });\n    }\n\n    this.#requestInit = {\n      ...config.requestInit,\n      headers: getHeaders(config, config.requestInit?.headers),\n    };\n\n    this.#customRequestFn = config.httpClient;\n    this.#requestTimeout = config.timeout;\n  }\n\n  /**\n   * Combines provided extra {@link RequestInit} headers, provided content type\n   * and class instance RequestInit headers, prioritizing them in this order.\n   *\n   * @returns A new Headers object or the main headers of this class if no\n   *   headers are provided\n   */\n  #getHeaders(extraHeaders?: HeadersInit, contentType?: string): Headers {\n    if (extraHeaders === undefined && contentType === undefined) {\n      return this.#requestInit.headers;\n    }\n\n    const headers = new Headers(extraHeaders);\n\n    if (contentType !== undefined && !headers.has(\"Content-Type\")) {\n      headers.set(\"Content-Type\", contentType);\n    }\n\n    for (const [key, val] of this.#requestInit.headers) {\n      if (!headers.has(key)) {\n        headers.set(key, val);\n      }\n    }\n\n    return headers;\n  }\n\n  /**\n   * Prepares common request parameters (URL and RequestInit).\n   *\n   * @returns Object containing the prepared URL and RequestInit\n   */\n  #prepareRequest({\n    path,\n    method,\n    params,\n    contentType,\n    body,\n    extraRequestInit,\n  }: MainRequestOptions): { url: URL; init: RequestInit } {\n    const url = new URL(path, this.#url);\n    if (params !== undefined) {\n      appendRecordToURLSearchParams(url.searchParams, params);\n    }\n\n    const init: RequestInit = {\n      method,\n      body:\n        contentType === undefined || typeof body !== \"string\"\n          ? JSON.stringify(body)\n          : body,\n      ...extraRequestInit,\n      ...this.#requestInit,\n      headers: this.#getHeaders(extraRequestInit?.headers, contentType),\n    };\n\n    return { url, init };\n  }\n\n  /**\n   * Sends a request with {@link fetch} or a custom HTTP client, combining\n   * parameters and class properties.\n   *\n   * @returns A promise containing the response\n   */\n  async #request<T = unknown>(options: MainRequestOptions): Promise<T> {\n    const { url, init } = this.#prepareRequest(options);\n\n    const startTimeout =\n      this.#requestTimeout !== undefined\n        ? getTimeoutFn(init, this.#requestTimeout)\n        : null;\n\n    const stopTimeout = startTimeout?.();\n\n    let response: Response;\n    let responseBody: string;\n    try {\n      if (this.#customRequestFn !== undefined) {\n        // When using a custom HTTP client, the response should already be handled and ready to be returned\n        return (await this.#customRequestFn(url, init)) as T;\n      }\n\n      response = await fetch(url, init);\n      responseBody = await response.text();\n    } catch (error) {\n      throw new MeiliSearchRequestError(\n        url.toString(),\n        Object.is(error, TIMEOUT_ID)\n          ? new MeiliSearchRequestTimeOutError(this.#requestTimeout!, init)\n          : error,\n      );\n    } finally {\n      stopTimeout?.();\n    }\n\n    const parsedResponse =\n      responseBody === \"\"\n        ? undefined\n        : (JSON.parse(responseBody) as T | MeiliSearchErrorResponse);\n\n    if (!response.ok) {\n      throw new MeiliSearchApiError(\n        response,\n        parsedResponse as MeiliSearchErrorResponse | undefined,\n      );\n    }\n\n    return parsedResponse as T;\n  }\n\n  /** Request with GET. */\n  get<T = unknown>(options: RequestOptions): Promise<T> {\n    return this.#request<T>(options);\n  }\n\n  /** Request with POST. */\n  post<T = unknown>(options: RequestOptions): Promise<T> {\n    return this.#request<T>({ ...options, method: \"POST\" });\n  }\n\n  /** Request with PUT. */\n  put<T = unknown>(options: RequestOptions): Promise<T> {\n    return this.#request<T>({ ...options, method: \"PUT\" });\n  }\n\n  /** Request with PATCH. */\n  patch<T = unknown>(options: RequestOptions): Promise<T> {\n    return this.#request<T>({ ...options, method: \"PATCH\" });\n  }\n\n  /** Request with DELETE. */\n  delete<T = unknown>(options: RequestOptions): Promise<T> {\n    return this.#request<T>({ ...options, method: \"DELETE\" });\n  }\n\n  /** Request with POST that returns a stream. */\n  postStream(options: RequestOptions): Promise<ReadableStream<Uint8Array>> {\n    return this.#requestStream({ ...options, method: \"POST\" });\n  }\n\n  /**\n   * Sends a request that returns a ReadableStream for streaming responses.\n   *\n   * @returns A promise containing the response stream\n   */\n  async #requestStream(\n    options: MainRequestOptions,\n  ): Promise<ReadableStream<Uint8Array>> {\n    const { url, init } = this.#prepareRequest(options);\n\n    const startTimeout =\n      this.#requestTimeout !== undefined\n        ? getTimeoutFn(init, this.#requestTimeout)\n        : null;\n\n    const stopTimeout = startTimeout?.();\n\n    let response: Response;\n    try {\n      if (this.#customRequestFn !== undefined) {\n        const result = await this.#customRequestFn(url, init);\n        if (!(result instanceof ReadableStream)) {\n          throw new MeiliSearchError(\n            \"Custom HTTP client must return a ReadableStream for streaming requests\",\n          );\n        }\n        return result as ReadableStream<Uint8Array>;\n      }\n\n      response = await fetch(url, init);\n    } catch (error) {\n      throw new MeiliSearchRequestError(\n        url.toString(),\n        Object.is(error, TIMEOUT_ID)\n          ? new MeiliSearchRequestTimeOutError(this.#requestTimeout!, init)\n          : error,\n      );\n    } finally {\n      stopTimeout?.();\n    }\n\n    if (!response.ok) {\n      // For error responses, we still need to read the body to get error details\n      const responseBody = await response.text();\n      const parsedResponse =\n        responseBody === \"\"\n          ? undefined\n          : (JSON.parse(responseBody) as MeiliSearchErrorResponse);\n\n      throw new MeiliSearchApiError(response, parsedResponse);\n    }\n\n    if (!response.body) {\n      throw new MeiliSearchError(\n        \"Response body is null - server did not return a readable stream\",\n      );\n    }\n\n    return response.body;\n  }\n}\n","import { MeiliSearchTaskTimeOutError } from \"./errors/index.js\";\nimport type {\n  WaitOptions,\n  TasksOrBatchesQuery,\n  TasksResults,\n  Task,\n  DeleteOrCancelTasksQuery,\n  EnqueuedTask,\n  EnqueuedTaskPromise,\n  TaskUidOrEnqueuedTask,\n  ExtraRequestInit,\n} from \"./types/index.js\";\nimport type { HttpRequests } from \"./http-requests.js\";\n\n/**\n * Used to identify whether an error is a timeout error in\n * {@link TaskClient.waitForTask}.\n */\nconst TIMEOUT_ID = Symbol(\"<task timeout>\");\n\n/**\n * @returns A function which defines an extra function property on a\n *   {@link Promise}, which resolves to {@link EnqueuedTask}, which awaits it and\n *   resolves to a {@link Task}.\n */\nfunction getWaitTaskApplier(\n  taskClient: TaskClient,\n): (enqueuedTaskPromise: Promise<EnqueuedTask>) => EnqueuedTaskPromise {\n  return function (\n    enqueuedTaskPromise: Promise<EnqueuedTask>,\n  ): EnqueuedTaskPromise {\n    return Object.defineProperty(\n      enqueuedTaskPromise,\n      \"waitTask\" satisfies keyof Pick<EnqueuedTaskPromise, \"waitTask\">,\n      {\n        async value(waitOptions?: WaitOptions): Promise<Task> {\n          return await taskClient.waitForTask(\n            await enqueuedTaskPromise,\n            waitOptions,\n          );\n        },\n      },\n    ) as EnqueuedTaskPromise;\n  };\n}\n\nconst getTaskUid = (taskUidOrEnqueuedTask: TaskUidOrEnqueuedTask): number =>\n  typeof taskUidOrEnqueuedTask === \"number\"\n    ? taskUidOrEnqueuedTask\n    : taskUidOrEnqueuedTask.taskUid;\n\n/**\n * Class for handling tasks.\n *\n * @see {@link https://www.meilisearch.com/docs/reference/api/tasks}\n */\nexport class TaskClient {\n  readonly #httpRequest: HttpRequests;\n  readonly #defaultTimeout: number;\n  readonly #defaultInterval: number;\n  readonly #applyWaitTask: ReturnType<typeof getWaitTaskApplier>;\n\n  constructor(httpRequest: HttpRequests, defaultWaitOptions?: WaitOptions) {\n    this.#httpRequest = httpRequest;\n    this.#defaultTimeout = defaultWaitOptions?.timeout ?? 5_000;\n    this.#defaultInterval = defaultWaitOptions?.interval ?? 50;\n    this.#applyWaitTask = getWaitTaskApplier(this);\n  }\n\n  /** {@link https://www.meilisearch.com/docs/reference/api/tasks#get-one-task} */\n  async getTask(\n    uid: number,\n    // TODO: Need to do this for all other methods: https://github.com/meilisearch/meilisearch-js/issues/1476\n    extraRequestInit?: ExtraRequestInit,\n  ): Promise<Task> {\n    return await this.#httpRequest.get({\n      path: `tasks/${uid}`,\n      extraRequestInit,\n    });\n  }\n\n  /** {@link https://www.meilisearch.com/docs/reference/api/tasks#get-tasks} */\n  async getTasks(params?: TasksOrBatchesQuery): Promise<TasksResults> {\n    return await this.#httpRequest.get({ path: \"tasks\", params });\n  }\n\n  /**\n   * Wait for an enqueued task to be processed. This is done through polling\n   * with {@link TaskClient.getTask}.\n   *\n   * @remarks\n   * If an {@link EnqueuedTask} needs to be awaited instantly, it is recommended\n   * to instead use {@link EnqueuedTaskPromise.waitTask}, which is available on\n   * any method that returns an {@link EnqueuedTaskPromise}.\n   */\n  async waitForTask(\n    taskUidOrEnqueuedTask: TaskUidOrEnqueuedTask,\n    options?: WaitOptions,\n  ): Promise<Task> {\n    const taskUid = getTaskUid(taskUidOrEnqueuedTask);\n    const timeout = options?.timeout ?? this.#defaultTimeout;\n    const interval = options?.interval ?? this.#defaultInterval;\n\n    const ac = timeout > 0 ? new AbortController() : null;\n\n    const toId =\n      ac !== null\n        ? setTimeout(() => void ac.abort(TIMEOUT_ID), timeout)\n        : undefined;\n\n    try {\n      for (;;) {\n        const task = await this.getTask(taskUid, { signal: ac?.signal });\n\n        if (task.status !== \"enqueued\" && task.status !== \"processing\") {\n          clearTimeout(toId);\n          return task;\n        }\n\n        if (interval > 0) {\n          await new Promise((resolve) => setTimeout(resolve, interval));\n        }\n      }\n    } catch (error) {\n      throw Object.is((error as Error).cause, TIMEOUT_ID)\n        ? new MeiliSearchTaskTimeOutError(taskUid, timeout)\n        : error;\n    }\n  }\n\n  /**\n   * Lazily wait for multiple enqueued tasks to be processed.\n   *\n   * @remarks\n   * In this case {@link WaitOptions.timeout} is the maximum time to wait for any\n   * one task, not for all of the tasks to complete.\n   */\n  async *waitForTasksIter(\n    taskUidsOrEnqueuedTasks:\n      | Iterable<TaskUidOrEnqueuedTask>\n      | AsyncIterable<TaskUidOrEnqueuedTask>,\n    options?: WaitOptions,\n  ): AsyncGenerator<Task, void, undefined> {\n    for await (const taskUidOrEnqueuedTask of taskUidsOrEnqueuedTasks) {\n      yield await this.waitForTask(taskUidOrEnqueuedTask, options);\n    }\n  }\n\n  /** Wait for multiple enqueued tasks to be processed. */\n  async waitForTasks(\n    ...params: Parameters<typeof this.waitForTasksIter>\n  ): Promise<Task[]> {\n    const tasks: Task[] = [];\n\n    for await (const task of this.waitForTasksIter(...params)) {\n      tasks.push(task);\n    }\n\n    return tasks;\n  }\n\n  /** {@link https://www.meilisearch.com/docs/reference/api/tasks#cancel-tasks} */\n  cancelTasks(params: DeleteOrCancelTasksQuery): EnqueuedTaskPromise {\n    return this.#applyWaitTask(\n      this.#httpRequest.post({ path: \"tasks/cancel\", params }),\n    );\n  }\n\n  /** {@link https://www.meilisearch.com/docs/reference/api/tasks#delete-tasks} */\n  deleteTasks(params: DeleteOrCancelTasksQuery): EnqueuedTaskPromise {\n    return this.#applyWaitTask(\n      this.#httpRequest.delete({ path: \"tasks\", params }),\n    );\n  }\n}\n\ntype PickedHttpRequestMethods = Pick<\n  HttpRequests,\n  \"post\" | \"put\" | \"patch\" | \"delete\"\n>;\nexport type HttpRequestsWithEnqueuedTaskPromise = {\n  [TKey in keyof PickedHttpRequestMethods]: (\n    ...params: Parameters<PickedHttpRequestMethods[TKey]>\n  ) => EnqueuedTaskPromise;\n};\n\nexport function getHttpRequestsWithEnqueuedTaskPromise(\n  httpRequest: HttpRequests,\n  taskClient: TaskClient,\n): HttpRequestsWithEnqueuedTaskPromise {\n  const applyWaitTask = getWaitTaskApplier(taskClient);\n\n  return {\n    post: (...params) => applyWaitTask(httpRequest.post(...params)),\n    put: (...params) => applyWaitTask(httpRequest.put(...params)),\n    patch: (...params) => applyWaitTask(httpRequest.patch(...params)),\n    delete: (...params) => applyWaitTask(httpRequest.delete(...params)),\n  };\n}\n","/*\n * Bundle: MeiliSearch / Indexes\n * Project: MeiliSearch - Javascript API\n * Author: Quentin de Quelen <quentin@meilisearch.com>\n * Copyright: 2019, MeiliSearch\n */\n\nimport { MeiliSearchError } from \"./errors/index.js\";\nimport type {\n  Config,\n  SearchResponse,\n  SearchParams,\n  Filter,\n  SearchRequestGET,\n  IndexObject,\n  IndexOptions,\n  IndexStats,\n  DocumentsQuery,\n  DocumentQuery,\n  DocumentOptions,\n  Settings,\n  Synonyms,\n  StopWords,\n  RankingRules,\n  DistinctAttribute,\n  FilterableAttributes,\n  SortableAttributes,\n  SearchableAttributes,\n  DisplayedAttributes,\n  TypoTolerance,\n  PaginationSettings,\n  Faceting,\n  ResourceResults,\n  RawDocumentAdditionOptions,\n  ContentType,\n  DocumentsIds,\n  DocumentsDeletionQuery,\n  SearchForFacetValuesParams,\n  SearchForFacetValuesResponse,\n  SeparatorTokens,\n  NonSeparatorTokens,\n  Dictionary,\n  ProximityPrecision,\n  Embedders,\n  SearchCutoffMs,\n  SearchSimilarDocumentsParams,\n  LocalizedAttributes,\n  UpdateDocumentsByFunctionOptions,\n  ExtraRequestInit,\n  PrefixSearch,\n  RecordAny,\n  EnqueuedTaskPromise,\n  ChatSettings,\n  ChatSettingsPayload,\n} from \"./types/index.js\";\nimport { HttpRequests } from \"./http-requests.js\";\nimport {\n  getHttpRequestsWithEnqueuedTaskPromise,\n  TaskClient,\n  type HttpRequestsWithEnqueuedTaskPromise,\n} from \"./task.js\";\n\nexport class Index<T extends RecordAny = RecordAny> {\n  uid: string;\n  primaryKey: string | undefined;\n  createdAt: Date | undefined;\n  updatedAt: Date | undefined;\n  httpRequest: HttpRequests;\n  tasks: TaskClient;\n  readonly #httpRequestsWithTask: HttpRequestsWithEnqueuedTaskPromise;\n\n  /**\n   * @param config - Request configuration options\n   * @param uid - UID of the index\n   * @param primaryKey - Primary Key of the index\n   */\n  constructor(config: Config, uid: string, primaryKey?: string) {\n    this.uid = uid;\n    this.primaryKey = primaryKey;\n    this.httpRequest = new HttpRequests(config);\n    this.tasks = new TaskClient(this.httpRequest, config.defaultWaitOptions);\n    this.#httpRequestsWithTask = getHttpRequestsWithEnqueuedTaskPromise(\n      this.httpRequest,\n      this.tasks,\n    );\n  }\n\n  ///\n  /// SEARCH\n  ///\n\n  /**\n   * Search for documents into an index\n   *\n   * @param query - Query string\n   * @param options - Search options\n   * @param config - Additional request configuration options\n   * @returns Promise containing the search response\n   */\n  async search<D extends RecordAny = T, S extends SearchParams = SearchParams>(\n    query?: string | null,\n    options?: S,\n    extraRequestInit?: ExtraRequestInit,\n  ): Promise<SearchResponse<D, S>> {\n    return await this.httpRequest.post<SearchResponse<D, S>>({\n      path: `indexes/${this.uid}/search`,\n      body: { q: query, ...options },\n      extraRequestInit,\n    });\n  }\n\n  /**\n   * Search for documents into an index using the GET method\n   *\n   * @param query - Query string\n   * @param options - Search options\n   * @param config - Additional request configuration options\n   * @returns Promise containing the search response\n   */\n  async searchGet<\n    D extends RecordAny = T,\n    S extends SearchParams = SearchParams,\n  >(\n    query?: string | null,\n    options?: S,\n    extraRequestInit?: ExtraRequestInit,\n  ): Promise<SearchResponse<D, S>> {\n    // TODO: Make this a type thing instead of a runtime thing\n    const parseFilter = (filter?: Filter): string | undefined => {\n      if (typeof filter === \"string\") return filter;\n      else if (Array.isArray(filter))\n        throw new MeiliSearchError(\n          \"The filter query parameter should be in string format when using searchGet\",\n        );\n      else return undefined;\n    };\n\n    const getParams: SearchRequestGET = {\n      q: query,\n      ...options,\n      filter: parseFilter(options?.filter),\n      sort: options?.sort?.join(\",\"),\n      facets: options?.facets?.join(\",\"),\n      attributesToRetrieve: options?.attributesToRetrieve?.join(\",\"),\n      attributesToCrop: options?.attributesToCrop?.join(\",\"),\n      attributesToHighlight: options?.attributesToHighlight?.join(\",\"),\n      vector: options?.vector?.join(\",\"),\n      attributesToSearchOn: options?.attributesToSearchOn?.join(\",\"),\n    };\n\n    return await this.httpRequest.get<SearchResponse<D, S>>({\n      path: `indexes/${this.uid}/search`,\n      params: getParams,\n      extraRequestInit,\n    });\n  }\n\n  /**\n   * Search for facet values\n   *\n   * @param params - Parameters used to search on the facets\n   * @param config - Additional request configuration options\n   * @returns Promise containing the search response\n   */\n  async searchForFacetValues(\n    params: SearchForFacetValuesParams,\n    extraRequestInit?: ExtraRequestInit,\n  ): Promise<SearchForFacetValuesResponse> {\n    return await this.httpRequest.post<SearchForFacetValuesResponse>({\n      path: `indexes/${this.uid}/facet-search`,\n      body: params,\n      extraRequestInit,\n    });\n  }\n\n  /**\n   * Search for similar documents\n   *\n   * @param params - Parameters used to search for similar documents\n   * @returns Promise containing the search response\n   */\n  async searchSimilarDocuments<\n    D extends RecordAny = T,\n    S extends SearchParams = SearchParams,\n  >(params: SearchSimilarDocumentsParams): Promise<SearchResponse<D, S>> {\n    return await this.httpRequest.post<SearchResponse<D, S>>({\n      path: `indexes/${this.uid}/similar`,\n      body: params,\n    });\n  }\n\n  ///\n  /// INDEX\n  ///\n\n  /**\n   * Get index information.\n   *\n   * @returns Promise containing index information\n   */\n  async getRawInfo(): Promise<IndexObject> {\n    const res = await this.httpRequest.get<IndexObject>({\n      path: `indexes/${this.uid}`,\n    });\n    this.primaryKey = res.primaryKey;\n    this.updatedAt = new Date(res.updatedAt);\n    this.createdAt = new Date(res.createdAt);\n    return res;\n  }\n\n  /**\n   * Fetch and update Index information.\n   *\n   * @returns Promise to the current Index object with updated information\n   */\n  async fetchInfo(): Promise<this> {\n    await this.getRawInfo();\n    return this;\n  }\n\n  /**\n   * Get Primary Key.\n   *\n   * @returns Promise containing the Primary Key of the index\n   */\n  async fetchPrimaryKey(): Promise<string | undefined> {\n    this.primaryKey = (await this.getRawInfo()).primaryKey;\n    return this.primaryKey;\n  }\n\n  /**\n   * Create an index.\n   *\n   * @param uid - Unique identifier of the Index\n   * @param options - Index options\n   * @param config - Request configuration options\n   * @returns Newly created Index object\n   */\n  static create(\n    uid: string,\n    options: IndexOptions = {},\n    config: Config,\n  ): EnqueuedTaskPromise {\n    const httpRequests = new HttpRequests(config);\n    return getHttpRequestsWithEnqueuedTaskPromise(\n      httpRequests,\n      new TaskClient(httpRequests),\n    ).post({\n      path: \"indexes\",\n      body: { ...options, uid },\n    });\n  }\n\n  /**\n   * Update an index.\n   *\n   * @param data - Data to update\n   * @returns Promise to the current Index object with updated information\n   */\n  update(data?: IndexOptions): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.patch({\n      path: `indexes/${this.uid}`,\n      body: data,\n    });\n  }\n\n  /**\n   * Delete an index.\n   *\n   * @returns Promise which resolves when index is deleted successfully\n   */\n  delete(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}`,\n    });\n  }\n\n  ///\n  /// STATS\n  ///\n\n  /**\n   * Get stats of an index\n   *\n   * @returns Promise containing object with stats of the index\n   */\n  async getStats(): Promise<IndexStats> {\n    return await this.httpRequest.get<IndexStats>({\n      path: `indexes/${this.uid}/stats`,\n    });\n  }\n\n  ///\n  /// DOCUMENTS\n  ///\n\n  /**\n   * Get documents of an index.\n   *\n   * @param params - Parameters to browse the documents. Parameters can contain\n   *   the `filter` field only available in Meilisearch v1.2 and newer\n   * @returns Promise containing the returned documents\n   */\n  async getDocuments<D extends RecordAny = T>(\n    params?: DocumentsQuery<D>,\n  ): Promise<ResourceResults<D[]>> {\n    const relativeBaseURL = `indexes/${this.uid}/documents`;\n\n    return params?.filter !== undefined\n      ? // In case `filter` is provided, use `POST /documents/fetch`\n        await this.httpRequest.post<ResourceResults<D[]>>({\n          path: `${relativeBaseURL}/fetch`,\n          body: params,\n        })\n      : // Else use `GET /documents` method\n        await this.httpRequest.get<ResourceResults<D[]>>({\n          path: relativeBaseURL,\n          params,\n        });\n  }\n\n  /**\n   * Get one document\n   *\n   * @param documentId - Document ID\n   * @param parameters - Parameters applied on a document\n   * @returns Promise containing Document response\n   */\n  async getDocument<D extends RecordAny = T>(\n    documentId: string | number,\n    parameters?: DocumentQuery<T>,\n  ): Promise<D> {\n    const fields = Array.isArray(parameters?.fields)\n      ? parameters.fields.join()\n      : undefined;\n\n    return await this.httpRequest.get<D>({\n      path: `indexes/${this.uid}/documents/${documentId}`,\n      params: { ...parameters, fields },\n    });\n  }\n\n  /**\n   * Add or replace multiples documents to an index\n   *\n   * @param documents - Array of Document objects to add/replace\n   * @param options - Options on document addition\n   * @returns Promise containing an EnqueuedTask\n   */\n  addDocuments(documents: T[], options?: DocumentOptions): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.post({\n      path: `indexes/${this.uid}/documents`,\n      params: options,\n      body: documents,\n    });\n  }\n\n  /**\n   * Add or replace multiples documents in a string format to an index. It only\n   * supports csv, ndjson and json formats.\n   *\n   * @param documents - Documents provided in a string to add/replace\n   * @param contentType - Content type of your document:\n   *   'text/csv'|'application/x-ndjson'|'application/json'\n   * @param options - Options on document addition\n   * @returns Promise containing an EnqueuedTask\n   */\n  addDocumentsFromString(\n    documents: string,\n    contentType: ContentType,\n    queryParams?: RawDocumentAdditionOptions,\n  ): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.post({\n      path: `indexes/${this.uid}/documents`,\n      body: documents,\n      params: queryParams,\n      contentType,\n    });\n  }\n\n  /**\n   * Add or replace multiples documents to an index in batches\n   *\n   * @param documents - Array of Document objects to add/replace\n   * @param batchSize - Size of the batch\n   * @param options - Options on document addition\n   * @returns Promise containing array of enqueued task objects for each batch\n   */\n  addDocumentsInBatches(\n    documents: T[],\n    batchSize = 1000,\n    options?: DocumentOptions,\n  ): EnqueuedTaskPromise[] {\n    const updates: EnqueuedTaskPromise[] = [];\n\n    for (let i = 0; i < documents.length; i += batchSize) {\n      updates.push(\n        this.addDocuments(documents.slice(i, i + batchSize), options),\n      );\n    }\n\n    return updates;\n  }\n\n  /**\n   * Add or update multiples documents to an index\n   *\n   * @param documents - Array of Document objects to add/update\n   * @param options - Options on document update\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateDocuments(\n    documents: Partial<T>[],\n    options?: DocumentOptions,\n  ): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/documents`,\n      params: options,\n      body: documents,\n    });\n  }\n\n  /**\n   * Add or update multiples documents to an index in batches\n   *\n   * @param documents - Array of Document objects to add/update\n   * @param batchSize - Size of the batch\n   * @param options - Options on document update\n   * @returns Promise containing array of enqueued task objects for each batch\n   */\n  updateDocumentsInBatches(\n    documents: Partial<T>[],\n    batchSize = 1000,\n    options?: DocumentOptions,\n  ): EnqueuedTaskPromise[] {\n    const updates: EnqueuedTaskPromise[] = [];\n\n    for (let i = 0; i < documents.length; i += batchSize) {\n      updates.push(\n        this.updateDocuments(documents.slice(i, i + batchSize), options),\n      );\n    }\n\n    return updates;\n  }\n\n  /**\n   * Add or update multiples documents in a string format to an index. It only\n   * supports csv, ndjson and json formats.\n   *\n   * @param documents - Documents provided in a string to add/update\n   * @param contentType - Content type of your document:\n   *   'text/csv'|'application/x-ndjson'|'application/json'\n   * @param queryParams - Options on raw document addition\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateDocumentsFromString(\n    documents: string,\n    contentType: ContentType,\n    queryParams?: RawDocumentAdditionOptions,\n  ): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/documents`,\n      body: documents,\n      params: queryParams,\n      contentType,\n    });\n  }\n\n  /**\n   * Delete one document\n   *\n   * @param documentId - Id of Document to delete\n   * @returns Promise containing an EnqueuedTask\n   */\n  deleteDocument(documentId: string | number): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/documents/${documentId}`,\n    });\n  }\n\n  /**\n   * Delete multiples documents of an index.\n   *\n   * @param params - Params value can be:\n   *\n   *   - DocumentsDeletionQuery: An object containing the parameters to customize\n   *       your document deletion. Only available in Meilisearch v1.2 and newer\n   *   - DocumentsIds: An array of document ids to delete\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  deleteDocuments(\n    params: DocumentsDeletionQuery | DocumentsIds,\n  ): EnqueuedTaskPromise {\n    // If params is of type DocumentsDeletionQuery\n    const isDocumentsDeletionQuery =\n      !Array.isArray(params) && typeof params === \"object\";\n    const endpoint = isDocumentsDeletionQuery\n      ? \"documents/delete\"\n      : \"documents/delete-batch\";\n\n    return this.#httpRequestsWithTask.post({\n      path: `indexes/${this.uid}/${endpoint}`,\n      body: params,\n    });\n  }\n\n  /**\n   * Delete all documents of an index\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  deleteAllDocuments(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/documents`,\n    });\n  }\n\n  /**\n   * This is an EXPERIMENTAL feature, which may break without a major version.\n   * It's available after Meilisearch v1.10.\n   *\n   * More info about the feature:\n   * https://github.com/orgs/meilisearch/discussions/762 More info about\n   * experimental features in general:\n   * https://www.meilisearch.com/docs/reference/api/experimental-features\n   *\n   * @param options - Object containing the function string and related options\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateDocumentsByFunction(\n    options: UpdateDocumentsByFunctionOptions,\n  ): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.post({\n      path: `indexes/${this.uid}/documents/edit`,\n      body: options,\n    });\n  }\n\n  ///\n  /// SETTINGS\n  ///\n\n  /**\n   * Retrieve all settings\n   *\n   * @returns Promise containing Settings object\n   */\n  async getSettings(): Promise<Settings> {\n    return await this.httpRequest.get<Settings>({\n      path: `indexes/${this.uid}/settings`,\n    });\n  }\n\n  /**\n   * Update all settings Any parameters not provided will be left unchanged.\n   *\n   * @param settings - Object containing parameters with their updated values\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateSettings(settings: Settings): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.patch({\n      path: `indexes/${this.uid}/settings`,\n      body: settings,\n    });\n  }\n\n  /**\n   * Reset settings.\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetSettings(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings`,\n    });\n  }\n\n  ///\n  /// PAGINATION SETTINGS\n  ///\n\n  /**\n   * Get the pagination settings.\n   *\n   * @returns Promise containing object of pagination settings\n   */\n  async getPagination(): Promise<PaginationSettings> {\n    return await this.httpRequest.get<PaginationSettings>({\n      path: `indexes/${this.uid}/settings/pagination`,\n    });\n  }\n\n  /**\n   * Update the pagination settings.\n   *\n   * @param pagination - Pagination object\n   * @returns Promise containing an EnqueuedTask\n   */\n  updatePagination(pagination: PaginationSettings): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.patch({\n      path: `indexes/${this.uid}/settings/pagination`,\n      body: pagination,\n    });\n  }\n\n  /**\n   * Reset the pagination settings.\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetPagination(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/pagination`,\n    });\n  }\n\n  ///\n  /// SYNONYMS\n  ///\n\n  /**\n   * Get the list of all synonyms\n   *\n   * @returns Promise containing record of synonym mappings\n   */\n  async getSynonyms(): Promise<Record<string, string[]>> {\n    return await this.httpRequest.get<Record<string, string[]>>({\n      path: `indexes/${this.uid}/settings/synonyms`,\n    });\n  }\n\n  /**\n   * Update the list of synonyms. Overwrite the old list.\n   *\n   * @param synonyms - Mapping of synonyms with their associated words\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateSynonyms(synonyms: Synonyms): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/synonyms`,\n      body: synonyms,\n    });\n  }\n\n  /**\n   * Reset the synonym list to be empty again\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetSynonyms(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/synonyms`,\n    });\n  }\n\n  ///\n  /// STOP WORDS\n  ///\n\n  /**\n   * Get the list of all stop-words\n   *\n   * @returns Promise containing array of stop-words\n   */\n  async getStopWords(): Promise<string[]> {\n    return await this.httpRequest.get<string[]>({\n      path: `indexes/${this.uid}/settings/stop-words`,\n    });\n  }\n\n  /**\n   * Update the list of stop-words. Overwrite the old list.\n   *\n   * @param stopWords - Array of strings that contains the stop-words.\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateStopWords(stopWords: StopWords): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/stop-words`,\n      body: stopWords,\n    });\n  }\n\n  /**\n   * Reset the stop-words list to be empty again\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetStopWords(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/stop-words`,\n    });\n  }\n\n  ///\n  /// RANKING RULES\n  ///\n\n  /**\n   * Get the list of all ranking-rules\n   *\n   * @returns Promise containing array of ranking-rules\n   */\n  async getRankingRules(): Promise<string[]> {\n    return await this.httpRequest.get<string[]>({\n      path: `indexes/${this.uid}/settings/ranking-rules`,\n    });\n  }\n\n  /**\n   * Update the list of ranking-rules. Overwrite the old list.\n   *\n   * @param rankingRules - Array that contain ranking rules sorted by order of\n   *   importance.\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateRankingRules(rankingRules: RankingRules): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/ranking-rules`,\n      body: rankingRules,\n    });\n  }\n\n  /**\n   * Reset the ranking rules list to its default value\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetRankingRules(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/ranking-rules`,\n    });\n  }\n\n  ///\n  /// DISTINCT ATTRIBUTE\n  ///\n\n  /**\n   * Get the distinct-attribute\n   *\n   * @returns Promise containing the distinct-attribute of the index\n   */\n  async getDistinctAttribute(): Promise<DistinctAttribute> {\n    return await this.httpRequest.get<DistinctAttribute>({\n      path: `indexes/${this.uid}/settings/distinct-attribute`,\n    });\n  }\n\n  /**\n   * Update the distinct-attribute.\n   *\n   * @param distinctAttribute - Field name of the distinct-attribute\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateDistinctAttribute(\n    distinctAttribute: DistinctAttribute,\n  ): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/distinct-attribute`,\n      body: distinctAttribute,\n    });\n  }\n\n  /**\n   * Reset the distinct-attribute.\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetDistinctAttribute(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/distinct-attribute`,\n    });\n  }\n\n  ///\n  /// FILTERABLE ATTRIBUTES\n  ///\n\n  /**\n   * Get the filterable-attributes\n   *\n   * @returns Promise containing an array of filterable-attributes\n   */\n  async getFilterableAttributes(): Promise<FilterableAttributes> {\n    return await this.httpRequest.get<FilterableAttributes>({\n      path: `indexes/${this.uid}/settings/filterable-attributes`,\n    });\n  }\n\n  /**\n   * Update the filterable-attributes.\n   *\n   * @param filterableAttributes - Array of strings containing the attributes\n   *   that can be used as filters at query time\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateFilterableAttributes(\n    filterableAttributes: FilterableAttributes,\n  ): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/filterable-attributes`,\n      body: filterableAttributes,\n    });\n  }\n\n  /**\n   * Reset the filterable-attributes.\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetFilterableAttributes(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/filterable-attributes`,\n    });\n  }\n\n  ///\n  /// SORTABLE ATTRIBUTES\n  ///\n\n  /**\n   * Get the sortable-attributes\n   *\n   * @returns Promise containing array of sortable-attributes\n   */\n  async getSortableAttributes(): Promise<string[]> {\n    return await this.httpRequest.get<string[]>({\n      path: `indexes/${this.uid}/settings/sortable-attributes`,\n    });\n  }\n\n  /**\n   * Update the sortable-attributes.\n   *\n   * @param sortableAttributes - Array of strings containing the attributes that\n   *   can be used to sort search results at query time\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateSortableAttributes(\n    sortableAttributes: SortableAttributes,\n  ): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/sortable-attributes`,\n      body: sortableAttributes,\n    });\n  }\n\n  /**\n   * Reset the sortable-attributes.\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetSortableAttributes(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/sortable-attributes`,\n    });\n  }\n\n  ///\n  /// SEARCHABLE ATTRIBUTE\n  ///\n\n  /**\n   * Get the searchable-attributes\n   *\n   * @returns Promise containing array of searchable-attributes\n   */\n  async getSearchableAttributes(): Promise<string[]> {\n    return await this.httpRequest.get<string[]>({\n      path: `indexes/${this.uid}/settings/searchable-attributes`,\n    });\n  }\n\n  /**\n   * Update the searchable-attributes.\n   *\n   * @param searchableAttributes - Array of strings that contains searchable\n   *   attributes sorted by order of importance(most to least important)\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateSearchableAttributes(\n    searchableAttributes: SearchableAttributes,\n  ): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/searchable-attributes`,\n      body: searchableAttributes,\n    });\n  }\n\n  /**\n   * Reset the searchable-attributes.\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetSearchableAttributes(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/searchable-attributes`,\n    });\n  }\n\n  ///\n  /// DISPLAYED ATTRIBUTE\n  ///\n\n  /**\n   * Get the displayed-attributes\n   *\n   * @returns Promise containing array of displayed-attributes\n   */\n  async getDisplayedAttributes(): Promise<string[]> {\n    return await this.httpRequest.get<string[]>({\n      path: `indexes/${this.uid}/settings/displayed-attributes`,\n    });\n  }\n\n  /**\n   * Update the displayed-attributes.\n   *\n   * @param displayedAttributes - Array of strings that contains attributes of\n   *   an index to display\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateDisplayedAttributes(\n    displayedAttributes: DisplayedAttributes,\n  ): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/displayed-attributes`,\n      body: displayedAttributes,\n    });\n  }\n\n  /**\n   * Reset the displayed-attributes.\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetDisplayedAttributes(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/displayed-attributes`,\n    });\n  }\n\n  ///\n  /// TYPO TOLERANCE\n  ///\n\n  /**\n   * Get the typo tolerance settings.\n   *\n   * @returns Promise containing the typo tolerance settings.\n   */\n  async getTypoTolerance(): Promise<TypoTolerance> {\n    return await this.httpRequest.get<TypoTolerance>({\n      path: `indexes/${this.uid}/settings/typo-tolerance`,\n    });\n  }\n\n  /**\n   * Update the typo tolerance settings.\n   *\n   * @param typoTolerance - Object containing the custom typo tolerance\n   *   settings.\n   * @returns Promise containing object of the enqueued update\n   */\n  updateTypoTolerance(typoTolerance: TypoTolerance): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.patch({\n      path: `indexes/${this.uid}/settings/typo-tolerance`,\n      body: typoTolerance,\n    });\n  }\n\n  /**\n   * Reset the typo tolerance settings.\n   *\n   * @returns Promise containing object of the enqueued update\n   */\n  resetTypoTolerance(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/typo-tolerance`,\n    });\n  }\n\n  ///\n  /// FACETING\n  ///\n\n  /**\n   * Get the faceting settings.\n   *\n   * @returns Promise containing object of faceting index settings\n   */\n  async getFaceting(): Promise<Faceting> {\n    return await this.httpRequest.get<Faceting>({\n      path: `indexes/${this.uid}/settings/faceting`,\n    });\n  }\n\n  /**\n   * Update the faceting settings.\n   *\n   * @param faceting - Faceting index settings object\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateFaceting(faceting: Faceting): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.patch({\n      path: `indexes/${this.uid}/settings/faceting`,\n      body: faceting,\n    });\n  }\n\n  /**\n   * Reset the faceting settings.\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetFaceting(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/faceting`,\n    });\n  }\n\n  ///\n  /// SEPARATOR TOKENS\n  ///\n\n  /**\n   * Get the list of all separator tokens.\n   *\n   * @returns Promise containing array of separator tokens\n   */\n  async getSeparatorTokens(): Promise<string[]> {\n    return await this.httpRequest.get<string[]>({\n      path: `indexes/${this.uid}/settings/separator-tokens`,\n    });\n  }\n\n  /**\n   * Update the list of separator tokens. Overwrite the old list.\n   *\n   * @param separatorTokens - Array that contains separator tokens.\n   * @returns Promise containing an EnqueuedTask or null\n   */\n  updateSeparatorTokens(separatorTokens: SeparatorTokens): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/separator-tokens`,\n      body: separatorTokens,\n    });\n  }\n\n  /**\n   * Reset the separator tokens list to its default value\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetSeparatorTokens(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/separator-tokens`,\n    });\n  }\n\n  ///\n  /// NON-SEPARATOR TOKENS\n  ///\n\n  /**\n   * Get the list of all non-separator tokens.\n   *\n   * @returns Promise containing array of non-separator tokens\n   */\n  async getNonSeparatorTokens(): Promise<string[]> {\n    return await this.httpRequest.get<string[]>({\n      path: `indexes/${this.uid}/settings/non-separator-tokens`,\n    });\n  }\n\n  /**\n   * Update the list of non-separator tokens. Overwrite the old list.\n   *\n   * @param nonSeparatorTokens - Array that contains non-separator tokens.\n   * @returns Promise containing an EnqueuedTask or null\n   */\n  updateNonSeparatorTokens(\n    nonSeparatorTokens: NonSeparatorTokens,\n  ): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/non-separator-tokens`,\n      body: nonSeparatorTokens,\n    });\n  }\n\n  /**\n   * Reset the non-separator tokens list to its default value\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetNonSeparatorTokens(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/non-separator-tokens`,\n    });\n  }\n\n  ///\n  /// DICTIONARY\n  ///\n\n  /**\n   * Get the dictionary settings of a Meilisearch index.\n   *\n   * @returns Promise containing the dictionary settings\n   */\n  async getDictionary(): Promise<string[]> {\n    return await this.httpRequest.get<string[]>({\n      path: `indexes/${this.uid}/settings/dictionary`,\n    });\n  }\n\n  /**\n   * Update the dictionary settings. Overwrite the old settings.\n   *\n   * @param dictionary - Array that contains the new dictionary settings.\n   * @returns Promise containing an EnqueuedTask or null\n   */\n  updateDictionary(dictionary: Dictionary): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/dictionary`,\n      body: dictionary,\n    });\n  }\n\n  /**\n   * Reset the dictionary settings to its default value\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetDictionary(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/dictionary`,\n    });\n  }\n\n  ///\n  /// PROXIMITY PRECISION\n  ///\n\n  /**\n   * Get the proximity precision settings of a Meilisearch index.\n   *\n   * @returns Promise containing the proximity precision settings\n   */\n  async getProximityPrecision(): Promise<ProximityPrecision> {\n    return await this.httpRequest.get<ProximityPrecision>({\n      path: `indexes/${this.uid}/settings/proximity-precision`,\n    });\n  }\n\n  /**\n   * Update the proximity precision settings. Overwrite the old settings.\n   *\n   * @param proximityPrecision - String that contains the new proximity\n   *   precision settings.\n   * @returns Promise containing an EnqueuedTask or null\n   */\n  updateProximityPrecision(\n    proximityPrecision: ProximityPrecision,\n  ): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/proximity-precision`,\n      body: proximityPrecision,\n    });\n  }\n\n  /**\n   * Reset the proximity precision settings to its default value\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetProximityPrecision(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/proximity-precision`,\n    });\n  }\n\n  ///\n  /// EMBEDDERS\n  ///\n\n  /**\n   * Get the embedders settings of a Meilisearch index.\n   *\n   * @returns Promise containing the embedders settings\n   */\n  async getEmbedders(): Promise<Embedders> {\n    return await this.httpRequest.get<Embedders>({\n      path: `indexes/${this.uid}/settings/embedders`,\n    });\n  }\n\n  /**\n   * Update the embedders settings. Overwrite the old settings.\n   *\n   * @param embedders - Object that contains the new embedders settings.\n   * @returns Promise containing an EnqueuedTask or null\n   */\n  updateEmbedders(embedders: Embedders): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.patch({\n      path: `indexes/${this.uid}/settings/embedders`,\n      body: embedders,\n    });\n  }\n\n  /**\n   * Reset the embedders settings to its default value\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetEmbedders(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/embedders`,\n    });\n  }\n\n  ///\n  /// SEARCHCUTOFFMS SETTINGS\n  ///\n\n  /**\n   * Get the SearchCutoffMs settings.\n   *\n   * @returns Promise containing object of SearchCutoffMs settings\n   */\n  async getSearchCutoffMs(): Promise<SearchCutoffMs> {\n    return await this.httpRequest.get<SearchCutoffMs>({\n      path: `indexes/${this.uid}/settings/search-cutoff-ms`,\n    });\n  }\n\n  /**\n   * Update the SearchCutoffMs settings.\n   *\n   * @param searchCutoffMs - Object containing SearchCutoffMsSettings\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateSearchCutoffMs(searchCutoffMs: SearchCutoffMs): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/search-cutoff-ms`,\n      body: searchCutoffMs,\n    });\n  }\n\n  /**\n   * Reset the SearchCutoffMs settings.\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetSearchCutoffMs(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/search-cutoff-ms`,\n    });\n  }\n\n  ///\n  /// LOCALIZED ATTRIBUTES SETTINGS\n  ///\n\n  /**\n   * Get the localized attributes settings.\n   *\n   * @returns Promise containing object of localized attributes settings\n   */\n  async getLocalizedAttributes(): Promise<LocalizedAttributes> {\n    return await this.httpRequest.get<LocalizedAttributes>({\n      path: `indexes/${this.uid}/settings/localized-attributes`,\n    });\n  }\n\n  /**\n   * Update the localized attributes settings.\n   *\n   * @param localizedAttributes - Localized attributes object\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateLocalizedAttributes(\n    localizedAttributes: LocalizedAttributes,\n  ): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/localized-attributes`,\n      body: localizedAttributes,\n    });\n  }\n\n  /**\n   * Reset the localized attributes settings.\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetLocalizedAttributes(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/localized-attributes`,\n    });\n  }\n\n  ///\n  /// FACET SEARCH SETTINGS\n  ///\n\n  /**\n   * Get the facet search settings.\n   *\n   * @returns Promise containing object of facet search settings\n   */\n  async getFacetSearch(): Promise<boolean> {\n    return await this.httpRequest.get<boolean>({\n      path: `indexes/${this.uid}/settings/facet-search`,\n    });\n  }\n\n  /**\n   * Update the facet search settings.\n   *\n   * @param facetSearch - Boolean value\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateFacetSearch(facetSearch: boolean): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/facet-search`,\n      body: facetSearch,\n    });\n  }\n\n  /**\n   * Reset the facet search settings.\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetFacetSearch(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/facet-search`,\n    });\n  }\n\n  ///\n  /// PREFIX SEARCH SETTINGS\n  ///\n\n  /**\n   * Get the prefix search settings.\n   *\n   * @returns Promise containing object of prefix search settings\n   */\n  async getPrefixSearch(): Promise<PrefixSearch> {\n    return await this.httpRequest.get<PrefixSearch>({\n      path: `indexes/${this.uid}/settings/prefix-search`,\n    });\n  }\n\n  /**\n   * Update the prefix search settings.\n   *\n   * @param prefixSearch - PrefixSearch value\n   * @returns Promise containing an EnqueuedTask\n   */\n  updatePrefixSearch(prefixSearch: PrefixSearch): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.put({\n      path: `indexes/${this.uid}/settings/prefix-search`,\n      body: prefixSearch,\n    });\n  }\n\n  /**\n   * Reset the prefix search settings.\n   *\n   * @returns Promise containing an EnqueuedTask\n   */\n  resetPrefixSearch(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.delete({\n      path: `indexes/${this.uid}/settings/prefix-search`,\n    });\n  }\n\n  ///\n  /// CHAT SETTINGS\n  ///\n\n  /**\n   * Get the index's chat settings.\n   *\n   * @returns Promise containing a ChatSettings object\n   */\n  async getChat(): Promise<ChatSettings> {\n    return await this.httpRequest.get<ChatSettings>({\n      path: `indexes/${this.uid}/settings/chat`,\n    });\n  }\n\n  /**\n   * Update the index's chat settings.\n   *\n   * @param chatSettings - ChatSettingsPayload object\n   * @returns Promise containing an EnqueuedTask\n   */\n  updateChat(chatSettings: ChatSettingsPayload): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.patch({\n      path: `indexes/${this.uid}/settings/chat`,\n      body: chatSettings,\n    });\n  }\n}\n","import type {\n  Batch,\n  BatchesResults,\n  TasksOrBatchesQuery,\n} from \"./types/index.js\";\nimport type { HttpRequests } from \"./http-requests.js\";\n\n/**\n * Class for handling batches.\n *\n * @see {@link https://www.meilisearch.com/docs/reference/api/batches}\n */\nexport class BatchClient {\n  readonly #httpRequest: HttpRequests;\n\n  constructor(httpRequests: HttpRequests) {\n    this.#httpRequest = httpRequests;\n  }\n\n  /** {@link https://www.meilisearch.com/docs/reference/api/batches#get-one-batch} */\n  async getBatch(uid: number): Promise<Batch> {\n    return await this.#httpRequest.get({ path: `batches/${uid}` });\n  }\n\n  /** {@link https://www.meilisearch.com/docs/reference/api/batches#get-batches} */\n  async getBatches(params?: TasksOrBatchesQuery): Promise<BatchesResults> {\n    return await this.#httpRequest.get({ path: \"batches\", params });\n  }\n}\n","import type { HttpRequests } from \"./http-requests.js\";\nimport type {\n  ChatWorkspaceSettings,\n  ChatCompletionRequest,\n} from \"./types/types.js\";\n\n/**\n * Class for handling chat workspaces.\n *\n * @see {@link https://www.meilisearch.com/docs/reference/api/chats}\n */\nexport class ChatWorkspace {\n  readonly #httpRequest: HttpRequests;\n  readonly #workspace: string;\n\n  constructor(httpRequests: HttpRequests, workspace: string) {\n    this.#httpRequest = httpRequests;\n    this.#workspace = workspace;\n  }\n\n  /**\n   * Get the settings of a chat workspace.\n   *\n   * @experimental\n   * @see {@link https://www.meilisearch.com/docs/reference/api/chats#get-chat-workspace-settings}\n   */\n  async get(): Promise<ChatWorkspaceSettings> {\n    return await this.#httpRequest.get({\n      path: `chats/${this.#workspace}/settings`,\n    });\n  }\n\n  /**\n   * Update the settings of a chat workspace.\n   *\n   * @experimental\n   * @see {@link https://www.meilisearch.com/docs/reference/api/chats#update-chat-workspace-settings}\n   */\n  async update(\n    settings: Partial<ChatWorkspaceSettings>,\n  ): Promise<ChatWorkspaceSettings> {\n    return await this.#httpRequest.patch({\n      path: `chats/${this.#workspace}/settings`,\n      body: settings,\n    });\n  }\n\n  /**\n   * Reset the settings of a chat workspace.\n   *\n   * @experimental\n   * @see {@link https://www.meilisearch.com/docs/reference/api/chats#reset-chat-workspace-settings}\n   */\n  async reset(): Promise<void> {\n    await this.#httpRequest.delete({\n      path: `chats/${this.#workspace}/settings`,\n    });\n  }\n\n  /**\n   * Create a chat completion using an OpenAI-compatible interface.\n   *\n   * @experimental\n   * @see {@link https://www.meilisearch.com/docs/reference/api/chats#chat-completions}\n   */\n  async streamCompletion(\n    completion: ChatCompletionRequest,\n  ): Promise<ReadableStream<Uint8Array>> {\n    if (!completion.stream) {\n      throw new Error(\"The SDK only supports streaming\");\n    }\n    return await this.#httpRequest.postStream({\n      path: `chats/${this.#workspace}/chat/completions`,\n      body: completion,\n    });\n  }\n}\n","/*\n * Bundle: MeiliSearch\n * Project: MeiliSearch - Javascript API\n * Author: Quentin de Quelen <quentin@meilisearch.com>\n * Copyright: 2019, MeiliSearch\n */\n\nimport { Index } from \"./indexes.js\";\nimport type {\n  KeyCreation,\n  Config,\n  IndexOptions,\n  IndexObject,\n  Key,\n  Health,\n  Stats,\n  Version,\n  KeyUpdate,\n  IndexesQuery,\n  IndexesResults,\n  KeysQuery,\n  KeysResults,\n  IndexSwap,\n  MultiSearchParams,\n  FederatedMultiSearchParams,\n  MultiSearchResponseOrSearchResponse,\n  EnqueuedTaskPromise,\n  ExtraRequestInit,\n  Network,\n  RecordAny,\n  RuntimeTogglableFeatures,\n  ResourceResults,\n  Webhook,\n  ResultsWrapper,\n  WebhookCreatePayload,\n  WebhookUpdatePayload,\n  UpdatableNetwork,\n} from \"./types/index.js\";\nimport { ErrorStatusCode } from \"./types/index.js\";\nimport { HttpRequests } from \"./http-requests.js\";\nimport {\n  getHttpRequestsWithEnqueuedTaskPromise,\n  TaskClient,\n  type HttpRequestsWithEnqueuedTaskPromise,\n} from \"./task.js\";\nimport { BatchClient } from \"./batch.js\";\nimport { ChatWorkspace } from \"./chat-workspace.js\";\nimport type { MeiliSearchApiError } from \"./errors/index.js\";\n\nexport class MeiliSearch {\n  config: Config;\n  httpRequest: HttpRequests;\n\n  readonly #taskClient: TaskClient;\n  get tasks() {\n    return this.#taskClient;\n  }\n\n  readonly #batchClient: BatchClient;\n  get batches() {\n    return this.#batchClient;\n  }\n\n  readonly #httpRequestsWithTask: HttpRequestsWithEnqueuedTaskPromise;\n\n  /**\n   * Creates new MeiliSearch instance\n   *\n   * @param config - Configuration object\n   */\n  constructor(config: Config) {\n    this.config = config;\n    this.httpRequest = new HttpRequests(config);\n\n    this.#taskClient = new TaskClient(\n      this.httpRequest,\n      config.defaultWaitOptions,\n    );\n    this.#batchClient = new BatchClient(this.httpRequest);\n\n    this.#httpRequestsWithTask = getHttpRequestsWithEnqueuedTaskPromise(\n      this.httpRequest,\n      this.tasks,\n    );\n  }\n\n  /**\n   * Return an Index instance\n   *\n   * @param indexUid - The index UID\n   * @returns Instance of Index\n   */\n  index<T extends RecordAny = RecordAny>(indexUid: string): Index<T> {\n    return new Index<T>(this.config, indexUid);\n  }\n\n  /**\n   * Gather information about an index by calling MeiliSearch and return an\n   * Index instance with the gathered information\n   *\n   * @param indexUid - The index UID\n   * @returns Promise returning Index instance\n   */\n  async getIndex<T extends RecordAny = RecordAny>(\n    indexUid: string,\n  ): Promise<Index<T>> {\n    return new Index<T>(this.config, indexUid).fetchInfo();\n  }\n\n  /**\n   * Gather information about an index by calling MeiliSearch and return the raw\n   * JSON response\n   *\n   * @param indexUid - The index UID\n   * @returns Promise returning index information\n   */\n  async getRawIndex(indexUid: string): Promise<IndexObject> {\n    return new Index(this.config, indexUid).getRawInfo();\n  }\n\n  /**\n   * Get all the indexes as Index instances.\n   *\n   * @param parameters - Parameters to browse the indexes\n   * @returns Promise returning array of raw index information\n   */\n  async getIndexes(\n    parameters?: IndexesQuery,\n  ): Promise<IndexesResults<Index[]>> {\n    const rawIndexes = await this.getRawIndexes(parameters);\n    const indexes: Index[] = rawIndexes.results.map(\n      (index) => new Index(this.config, index.uid, index.primaryKey),\n    );\n    return { ...rawIndexes, results: indexes };\n  }\n\n  /**\n   * Get all the indexes in their raw value (no Index instances).\n   *\n   * @param parameters - Parameters to browse the indexes\n   * @returns Promise returning array of raw index information\n   */\n  async getRawIndexes(\n    parameters?: IndexesQuery,\n  ): Promise<IndexesResults<IndexObject[]>> {\n    return await this.httpRequest.get<IndexesResults<IndexObject[]>>({\n      path: \"indexes\",\n      params: parameters,\n    });\n  }\n\n  /**\n   * Create a new index\n   *\n   * @param uid - The index UID\n   * @param options - Index options\n   * @returns Promise returning Index instance\n   */\n  createIndex(uid: string, options?: IndexOptions): EnqueuedTaskPromise {\n    return Index.create(uid, options, this.config);\n  }\n\n  /**\n   * Update an index\n   *\n   * @param uid - The index UID\n   * @param options - Index options to update\n   * @returns Promise returning Index instance after updating\n   */\n  updateIndex(uid: string, options?: IndexOptions): EnqueuedTaskPromise {\n    return new Index(this.config, uid).update(options);\n  }\n\n  /**\n   * Delete an index\n   *\n   * @param uid - The index UID\n   * @returns Promise which resolves when index is deleted successfully\n   */\n  deleteIndex(uid: string): EnqueuedTaskPromise {\n    return new Index(this.config, uid).delete();\n  }\n\n  /**\n   * Deletes an index if it already exists.\n   *\n   * @param uid - The index UID\n   * @returns Promise which resolves to true when index exists and is deleted\n   *   successfully, otherwise false if it does not exist\n   */\n  async deleteIndexIfExists(uid: string): Promise<boolean> {\n    try {\n      await this.deleteIndex(uid);\n      return true;\n    } catch (e) {\n      if (\n        (e as MeiliSearchApiError)?.cause?.code ===\n        ErrorStatusCode.INDEX_NOT_FOUND\n      ) {\n        return false;\n      }\n\n      throw e;\n    }\n  }\n\n  /**\n   * Swaps a list of index tuples.\n   *\n   * @param params - List of indexes tuples to swap.\n   * @returns Promise returning object of the enqueued task\n   */\n  swapIndexes(params: IndexSwap[]): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.post({\n      path: \"swap-indexes\",\n      body: params,\n    });\n  }\n\n  ///\n  /// Multi Search\n  ///\n\n  /**\n   * Perform multiple search queries.\n   *\n   * It is possible to make multiple search queries on the same index or on\n   * different ones. With network feature enabled, you can also search across\n   * remote instances.\n   *\n   * @example\n   *\n   * ```ts\n   * client.multiSearch({\n   *   queries: [\n   *     { indexUid: \"movies\", q: \"wonder\" },\n   *     { indexUid: \"books\", q: \"flower\" },\n   *   ],\n   * });\n   *\n   * // Federated search with remote instance (requires network feature enabled)\n   * client.multiSearch({\n   *   federation: {},\n   *   queries: [\n   *     {\n   *       indexUid: \"movies\",\n   *       q: \"wonder\",\n   *       federationOptions: {\n   *         remote: \"meilisearch instance name\",\n   *       },\n   *     },\n   *     {\n   *       indexUid: \"movies\",\n   *       q: \"wonder\",\n   *       federationOptions: {\n   *         remote: \"meilisearch instance name\",\n   *       },\n   *     },\n   *   ],\n   * });\n   * ```\n   *\n   * @param queries - Search queries\n   * @param extraRequestInit - Additional request configuration options\n   * @returns Promise containing the search responses\n   * @see {@link https://www.meilisearch.com/docs/learn/multi_search/implement_sharding#perform-a-search}\n   */\n  async multiSearch<\n    T1 extends MultiSearchParams | FederatedMultiSearchParams,\n    T2 extends RecordAny = RecordAny,\n  >(\n    queries: T1,\n    extraRequestInit?: ExtraRequestInit,\n  ): Promise<MultiSearchResponseOrSearchResponse<T1, T2>> {\n    return await this.httpRequest.post<\n      MultiSearchResponseOrSearchResponse<T1, T2>\n    >({\n      path: \"multi-search\",\n      body: queries,\n      extraRequestInit,\n    });\n  }\n\n  ///\n  /// CHATS\n  ///\n\n  /**\n   * Get a chat workspace instance\n   *\n   * @param workspace - The chat workspace UID\n   * @returns Instance of ChatWorkspace\n   */\n  chat(workspace: string): ChatWorkspace {\n    return new ChatWorkspace(this.httpRequest, workspace);\n  }\n\n  /**\n   * Get all chat workspaces\n   *\n   * @returns Promise returning an array of chat workspaces UIDs\n   */\n  async getChatWorkspaces(): Promise<ResourceResults<{ uid: string }[]>> {\n    return await this.httpRequest.get({\n      path: \"chats\",\n    });\n  }\n\n  ///\n  /// WEBHOOKS\n  ///\n\n  /**\n   * Get all webhooks\n   *\n   * @returns Promise returning an object with webhooks\n   */\n  async getWebhooks(): Promise<ResultsWrapper<Webhook[]>> {\n    return await this.httpRequest.get({ path: \"webhooks\" });\n  }\n\n  /**\n   * Get a webhook\n   *\n   * @param uuid - Webhook UUID\n   * @returns Promise returning the webhook\n   */\n  async getWebhook(uuid: string): Promise<Webhook> {\n    return await this.httpRequest.get({ path: `webhooks/${uuid}` });\n  }\n\n  /**\n   * Create a webhook\n   *\n   * @param webhook - Webhook to create\n   * @returns Promise returning the created webhook\n   */\n  async createWebhook(webhook: WebhookCreatePayload): Promise<Webhook> {\n    return await this.httpRequest.post({ path: \"webhooks\", body: webhook });\n  }\n\n  /**\n   * Update a webhook\n   *\n   * @param uuid - Webhook UUID\n   * @param webhook - Webhook to update\n   * @returns Promise returning the updated webhook\n   */\n  async updateWebhook(\n    uuid: string,\n    webhook: WebhookUpdatePayload,\n  ): Promise<Webhook> {\n    return await this.httpRequest.patch({\n      path: `webhooks/${uuid}`,\n      body: webhook,\n    });\n  }\n\n  /**\n   * Delete a webhook\n   *\n   * @param uuid - Webhook UUID\n   * @returns Promise returning void\n   */\n  async deleteWebhook(uuid: string): Promise<void> {\n    await this.httpRequest.delete({ path: `webhooks/${uuid}` });\n  }\n\n  ///\n  ///  Network\n  ///\n\n  /**\n   * {@link https://www.meilisearch.com/docs/reference/api/network#get-the-network-object}\n   *\n   * @experimental\n   */\n  async getNetwork(): Promise<Network> {\n    return await this.httpRequest.get({ path: \"network\" });\n  }\n\n  /**\n   * {@link https://www.meilisearch.com/docs/reference/api/network#update-the-network-object}\n   *\n   * @experimental\n   */\n  async updateNetwork(options: UpdatableNetwork): Promise<Network> {\n    return await this.httpRequest.patch({ path: \"network\", body: options });\n  }\n\n  ///\n  /// KEYS\n  ///\n\n  /**\n   * Get all API keys\n   *\n   * @param parameters - Parameters to browse the indexes\n   * @returns Promise returning an object with keys\n   */\n  async getKeys(parameters?: KeysQuery): Promise<KeysResults> {\n    const keys = await this.httpRequest.get<KeysResults>({\n      path: \"keys\",\n      params: parameters,\n    });\n\n    keys.results = keys.results.map((key) => ({\n      ...key,\n      createdAt: new Date(key.createdAt),\n      updatedAt: new Date(key.updatedAt),\n    }));\n\n    return keys;\n  }\n\n  /**\n   * Get one API key\n   *\n   * @param keyOrUid - Key or uid of the API key\n   * @returns Promise returning a key\n   */\n  async getKey(keyOrUid: string): Promise<Key> {\n    return await this.httpRequest.get<Key>({\n      path: `keys/${keyOrUid}`,\n    });\n  }\n\n  /**\n   * Create one API key\n   *\n   * @param options - Key options\n   * @returns Promise returning a key\n   */\n  async createKey(options: KeyCreation): Promise<Key> {\n    return await this.httpRequest.post<Key>({\n      path: \"keys\",\n      body: options,\n    });\n  }\n\n  /**\n   * Update one API key\n   *\n   * @param keyOrUid - Key\n   * @param options - Key options\n   * @returns Promise returning a key\n   */\n  async updateKey(keyOrUid: string, options: KeyUpdate): Promise<Key> {\n    return await this.httpRequest.patch<Key>({\n      path: `keys/${keyOrUid}`,\n      body: options,\n    });\n  }\n\n  /**\n   * Delete one API key\n   *\n   * @param keyOrUid - Key\n   * @returns\n   */\n  async deleteKey(keyOrUid: string): Promise<void> {\n    await this.httpRequest.delete({ path: `keys/${keyOrUid}` });\n  }\n\n  ///\n  /// HEALTH\n  ///\n\n  /**\n   * Checks if the server is healthy, otherwise an error will be thrown.\n   *\n   * @returns Promise returning an object with health details\n   */\n  async health(): Promise<Health> {\n    return await this.httpRequest.get<Health>({ path: \"health\" });\n  }\n\n  /**\n   * Checks if the server is healthy, return true or false.\n   *\n   * @returns Promise returning a boolean\n   */\n  async isHealthy(): Promise<boolean> {\n    try {\n      const { status } = await this.health();\n      return status === \"available\";\n    } catch {\n      return false;\n    }\n  }\n\n  ///\n  /// STATS\n  ///\n\n  /**\n   * Get the stats of all the database\n   *\n   * @returns Promise returning object of all the stats\n   */\n  async getStats(): Promise<Stats> {\n    return await this.httpRequest.get<Stats>({ path: \"stats\" });\n  }\n\n  ///\n  /// VERSION\n  ///\n\n  /**\n   * Get the version of MeiliSearch\n   *\n   * @returns Promise returning object with version details\n   */\n  async getVersion(): Promise<Version> {\n    return await this.httpRequest.get<Version>({ path: \"version\" });\n  }\n\n  ///\n  /// DUMPS\n  ///\n\n  /**\n   * Creates a dump\n   *\n   * @returns Promise returning object of the enqueued task\n   */\n  createDump(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.post({\n      path: \"dumps\",\n    });\n  }\n\n  ///\n  /// SNAPSHOTS\n  ///\n\n  /**\n   * Creates a snapshot\n   *\n   * @returns Promise returning object of the enqueued task\n   */\n  createSnapshot(): EnqueuedTaskPromise {\n    return this.#httpRequestsWithTask.post({\n      path: \"snapshots\",\n    });\n  }\n\n  ///\n  /// EXPERIMENTAL-FEATURES\n  ///\n\n  /** {@link https://www.meilisearch.com/docs/reference/api/experimental_features#get-all-experimental-features} */\n  async getExperimentalFeatures(): Promise<RuntimeTogglableFeatures> {\n    return await this.httpRequest.get({\n      path: \"experimental-features\",\n    });\n  }\n\n  /** {@link https://www.meilisearch.com/docs/reference/api/experimental_features#configure-experimental-features} */\n  async updateExperimentalFeatures(\n    runtimeTogglableFeatures: RuntimeTogglableFeatures,\n  ): Promise<RuntimeTogglableFeatures> {\n    return await this.httpRequest.patch({\n      path: \"experimental-features\",\n      body: runtimeTogglableFeatures,\n    });\n  }\n}\n","export * from \"./types/index.js\";\nexport * from \"./errors/index.js\";\nexport * from \"./indexes.js\";\nimport { MeiliSearch } from \"./meilisearch.js\";\n\n/**\n * Default export of {@link MeiliSearch}.\n *\n * @deprecated The default export will be removed in a future version.\n *   {@link https://github.com/meilisearch/meilisearch-js/issues/1789 | Issue}.\n */\nconst defaultExport = MeiliSearch;\n\nexport { MeiliSearch, MeiliSearch as Meilisearch };\nexport default defaultExport;\n"],"names":["TIMEOUT_ID"],"mappings":";;AAgKO,MAAM,qBAAqB;AAAA,EAChC,KAAK;AAAA,EACL,MAAM;AAAA,EACN,WAAW;AACb;AAgTO,MAAM,kBAAyD;AAAA,EACpE,MAAM;AAAA,EACN,KAAK;AAAA,EACL,QAAQ;AACV;AA0WO,MAAM,kBAAkB;AAAA;AAAA,EAE7B,uBAAuB;AAAA;AAAA,EAGvB,mBAAmB;AAAA;AAAA,EAGnB,sBAAsB;AAAA;AAAA,EAGtB,iBAAiB;AAAA;AAAA,EAGjB,mBAAmB;AAAA;AAAA,EAGnB,sBAAsB;AAAA;AAAA,EAGtB,sBAAsB;AAAA;AAAA,EAGtB,qBAAqB;AAAA;AAAA,EAGrB,eAAe;AAAA;AAAA,EAGf,8BAA8B;AAAA;AAAA,EAG9B,kCAAkC;AAAA;AAAA,EAGlC,2BAA2B;AAAA;AAAA,EAG3B,gCAAgC;AAAA;AAAA,EAGhC,qBAAqB;AAAA;AAAA,EAGrB,qBAAqB;AAAA;AAAA,EAGrB,sBAAsB;AAAA;AAAA,EAGtB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