Socket
Socket
Sign inDemoInstall

meilisearch

Package Overview
Dependencies
Maintainers
4
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meilisearch - npm Package Compare versions

Comparing version 0.22.1 to 0.22.2

4

CONTRIBUTING.md

@@ -64,4 +64,4 @@ # Contributing

# Tests
docker pull getmeili/meilisearch:latest # Fetch the latest version of MeiliSearch image from Docker Hub
docker run -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey --no-analytics=true
curl -L https://install.meilisearch.com | sh # download MeiliSearch
./meilisearch --master-key=masterKey --no-analytics=true # run MeiliSearch
yarn test

@@ -68,0 +68,0 @@ # Linter

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

// Type definitions for meilisearch 0.22.1
// Type definitions for meilisearch 0.22.2
// Project: https://github.com/meilisearch/meilisearch-js
// Definitions by: cvermand <charlotte@meilisearch.com> <https://github.com/meilisearch>
// Definitions: https://github.com/meilisearch/meilisearch-js
// TypeScript Version: 4.4.3
// TypeScript Version: 4.4.4

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

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

import { Config, Update, SearchResponse, SearchParams, IndexResponse, IndexOptions, IndexStats, GetDocumentsParams, GetDocumentsResponse, Document, AddDocumentParams, EnqueuedUpdate, Settings, Synonyms, StopWords, RankingRules, DistinctAttribute, FilterableAttributes, SortableAttributes, SearchableAttributes, DisplayedAttributes } from '../types';
import { Config, Update, SearchResponse, SearchParams, IndexResponse, IndexOptions, IndexStats, GetDocumentsParams, GetDocumentsResponse, Document, AddDocumentParams, EnqueuedUpdate, Settings, Synonyms, StopWords, RankingRules, DistinctAttribute, FilterableAttributes, SortableAttributes, SearchableAttributes, DisplayedAttributes, WaitForPendingUpdateOptions } from '../types';
import { HttpRequests } from './http-requests';

@@ -7,11 +7,24 @@ declare class Index<T = Record<string, any>> {

httpRequest: HttpRequests;
/**
* @param {Config} config Request configuration options
* @param {string} uid UID of the index
* @param {string} primaryKey? Primary Key of the index
*/
constructor(config: Config, uid: string, primaryKey?: string);
waitForPendingUpdate(updateId: number, { timeOutMs, intervalMs, }?: {
timeOutMs?: number;
intervalMs?: number;
}): Promise<Update>;
/**
* Waits for a pending update till it has been processed
* @param {number} updateId Update identifier
* @param {WaitForPendingUpdateOptions} options Additional configuration options
* @returns {Promise<Update>} Promise containing Update object after it has been processed
*/
waitForPendingUpdate(updateId: number, { timeOutMs, intervalMs }?: WaitForPendingUpdateOptions): Promise<Update>;
/**
* Search for documents into an index
* @memberof Index
* @method search
* @template T
* @param {string | null} query? Query string
* @param {SearchParams} options? Search options
* @param {Partial<Request>} config? Additional request configuration options
* @returns {Promise<SearchResponse<T>>} Promise containing the search response
*/

@@ -23,2 +36,7 @@ search<T = Record<string, any>>(query?: string | null, options?: SearchParams, config?: Partial<Request>): Promise<SearchResponse<T>>;

* @method search
* @template T
* @param {string | null} query? Query string
* @param {SearchParams} options? Search options
* @param {Partial<Request>} config? Additional request configuration options
* @returns {Promise<SearchResponse<T>>} Promise containing the search response
*/

@@ -30,2 +48,3 @@ searchGet<T = Record<string, any>>(query?: string | null, options?: SearchParams, config?: Partial<Request>): Promise<SearchResponse<T>>;

* @method getRawInfo
* @returns {Promise<IndexResponse>} Promise containing index information
*/

@@ -37,2 +56,3 @@ getRawInfo(): Promise<IndexResponse>;

* @method fetchInfo
* @returns {Promise<this>} Promise to the current Index object with updated information
*/

@@ -44,2 +64,3 @@ fetchInfo(): Promise<this>;

* @method fetchPrimaryKey
* @returns {Promise<string | undefined>} Promise containing the Primary Key of the index
*/

@@ -51,2 +72,7 @@ fetchPrimaryKey(): Promise<string | undefined>;

* @method create
* @template T
* @param {string} uid Unique identifier of the Index
* @param {IndexOptions} options Index options
* @param {Config} config Request configuration options
* @returns {Promise<Index<T>>} Newly created Index object
*/

@@ -58,2 +84,4 @@ static create<T = Record<string, any>>(uid: string, options: IndexOptions | undefined, config: Config): Promise<Index<T>>;

* @method update
* @param {IndexOptions} data Data to update
* @returns {Promise<this>} Promise to the current Index object with updated information
*/

@@ -65,2 +93,3 @@ update(data: IndexOptions): Promise<this>;

* @method delete
* @returns {Promise<void>} Promise which resolves when index is deleted successfully
*/

@@ -72,2 +101,3 @@ delete(): Promise<void>;

* @method deleteIfExists
* @returns {Promise<boolean>} Promise which resolves to true when index exists and is deleted successfully, otherwise false if it does not exist
*/

@@ -79,2 +109,3 @@ deleteIfExists(): Promise<boolean>;

* @method getAllUpdateStatus
* @returns {Promise<Update[]>} Promise containing array of Update objects
*/

@@ -86,2 +117,4 @@ getAllUpdateStatus(): Promise<Update[]>;

* @method getUpdateStatus
* @param {number} updateId Update identifier
* @returns {Promise<Update>} Promise containing the requested Update object
*/

@@ -93,2 +126,3 @@ getUpdateStatus(updateId: number): Promise<Update>;

* @method getStats
* @returns {Promise<IndexStats>} Promise containing object with stats of the index
*/

@@ -100,2 +134,5 @@ getStats(): Promise<IndexStats>;

* @method getDocuments
* @template T
* @param {GetDocumentsParams<T>} options? Options to browse the documents
* @returns {Promise<GetDocumentsResponse<T>>} Promise containing Document responses
*/

@@ -107,2 +144,5 @@ getDocuments<T = Record<string, any>>(options?: GetDocumentsParams<T>): Promise<GetDocumentsResponse<T>>;

* @method getDocument
* @template T
* @param {string | number} documentId Document ID
* @returns {Promise<Document<T>>} Promise containing Document response
*/

@@ -114,2 +154,6 @@ getDocument(documentId: string | number): Promise<Document<T>>;

* @method addDocuments
* @template T
* @param {Array<Document<T>>} documents Array of Document objects to add/replace
* @param {AddDocumentParams} options? Query parameters
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -121,2 +165,7 @@ addDocuments(documents: Array<Document<T>>, options?: AddDocumentParams): Promise<EnqueuedUpdate>;

* @method addDocumentsInBatches
* @template T
* @param {Array<Document<T>>} documents Array of Document objects to add/replace
* @param {number} batchSize Size of the batch
* @param {AddDocumentParams} options? Query parameters
* @returns {Promise<EnqueuedUpdate[]>} Promise containing array of enqueued update objects for each batch
*/

@@ -128,2 +177,5 @@ addDocumentsInBatches(documents: Array<Document<T>>, batchSize?: number, options?: AddDocumentParams): Promise<EnqueuedUpdate[]>;

* @method updateDocuments
* @param {Array<Document<T>>} documents Array of Document objects to add/update
* @param {AddDocumentParams} options? Query parameters
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -135,2 +187,7 @@ updateDocuments(documents: Array<Document<T>>, options?: AddDocumentParams): Promise<EnqueuedUpdate>;

* @method updateDocuments
* @template T
* @param {Array<Document<T>>} documents Array of Document objects to add/update
* @param {number} batchSize Size of the batch
* @param {AddDocumentParams} options? Query parameters
* @returns {Promise<EnqueuedUpdate[]>} Promise containing array of enqueued update objects for each batch
*/

@@ -142,2 +199,4 @@ updateDocumentsInBatches(documents: Array<Document<T>>, batchSize?: number, options?: AddDocumentParams): Promise<EnqueuedUpdate[]>;

* @method deleteDocument
* @param {string | number} documentId Id of Document to delete
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -149,2 +208,4 @@ deleteDocument(documentId: string | number): Promise<EnqueuedUpdate>;

* @method deleteDocuments
* @param {string[] | number[]} documentsIds Array of Document Ids to delete
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -156,2 +217,3 @@ deleteDocuments(documentsIds: string[] | number[]): Promise<EnqueuedUpdate>;

* @method deleteAllDocuments
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -163,2 +225,3 @@ deleteAllDocuments(): Promise<EnqueuedUpdate>;

* @method getSettings
* @returns {Promise<Settings>} Promise containing Settings object
*/

@@ -171,2 +234,4 @@ getSettings(): Promise<Settings>;

* @method updateSettings
* @param {Settings} settings Object containing parameters with their updated values
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -178,2 +243,3 @@ updateSettings(settings: Settings): Promise<EnqueuedUpdate>;

* @method resetSettings
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -185,2 +251,3 @@ resetSettings(): Promise<EnqueuedUpdate>;

* @method getSynonyms
* @returns {Promise<object>} Promise containing object of synonym mappings
*/

@@ -192,2 +259,4 @@ getSynonyms(): Promise<object>;

* @method updateSynonyms
* @param {Synonyms} synonyms Mapping of synonyms with their associated words
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -199,2 +268,3 @@ updateSynonyms(synonyms: Synonyms): Promise<EnqueuedUpdate>;

* @method resetSynonyms
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -206,2 +276,3 @@ resetSynonyms(): Promise<EnqueuedUpdate>;

* @method getStopWords
* @returns {Promise<string[]>} Promise containing array of stop-words
*/

@@ -213,2 +284,4 @@ getStopWords(): Promise<string[]>;

* @method updateStopWords
* @param {StopWords} stopWords Array of strings that contains the stop-words.
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -220,2 +293,3 @@ updateStopWords(stopWords: StopWords): Promise<EnqueuedUpdate>;

* @method resetStopWords
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -227,2 +301,3 @@ resetStopWords(): Promise<EnqueuedUpdate>;

* @method getRankingRules
* @returns {Promise<string[]} Promise containing array of ranking-rules
*/

@@ -234,2 +309,4 @@ getRankingRules(): Promise<string[]>;

* @method updateRankingRules
* @param {RankingRules} rankingRules Array that contain ranking rules sorted by order of importance.
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -241,2 +318,3 @@ updateRankingRules(rankingRules: RankingRules): Promise<EnqueuedUpdate>;

* @method resetRankingRules
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -248,2 +326,3 @@ resetRankingRules(): Promise<EnqueuedUpdate>;

* @method getDistinctAttribute
* @returns {Promise<string | null>} Promise containing the distinct-attribute of the index
*/

@@ -255,2 +334,4 @@ getDistinctAttribute(): Promise<string | null>;

* @method updateDistinctAttribute
* @param {DistinctAttribute} distinctAttribute Field name of the distinct-attribute
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -262,2 +343,3 @@ updateDistinctAttribute(distinctAttribute: DistinctAttribute): Promise<EnqueuedUpdate>;

* @method resetDistinctAttribute
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -269,2 +351,3 @@ resetDistinctAttribute(): Promise<EnqueuedUpdate>;

* @method getFilterableAttributes
* @returns {Promise<string[]>} Promise containing an array of filterable-attributes
*/

@@ -276,2 +359,4 @@ getFilterableAttributes(): Promise<string[]>;

* @method updateFilterableAttributes
* @param {FilterableAttributes} filterableAttributes Array of strings containing the attributes that can be used as filters at query time
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -283,2 +368,3 @@ updateFilterableAttributes(filterableAttributes: FilterableAttributes): Promise<EnqueuedUpdate>;

* @method resetFilterableAttributes
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -290,2 +376,3 @@ resetFilterableAttributes(): Promise<EnqueuedUpdate>;

* @method getSortableAttributes
* @returns {Promise<string[]>} Promise containing array of sortable-attributes
*/

@@ -297,2 +384,4 @@ getSortableAttributes(): Promise<string[]>;

* @method updateSortableAttributes
* @param {SortableAttributes} sortableAttributes Array of strings containing the attributes that can be used to sort search results at query time
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -304,2 +393,3 @@ updateSortableAttributes(sortableAttributes: SortableAttributes): Promise<EnqueuedUpdate>;

* @method resetSortableAttributes
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -311,2 +401,3 @@ resetSortableAttributes(): Promise<EnqueuedUpdate>;

* @method getSearchableAttributes
* @returns {Promise<string[]>} Promise containing array of searchable-attributes
*/

@@ -318,2 +409,4 @@ getSearchableAttributes(): Promise<string[]>;

* @method updateSearchableAttributes
* @param {SearchableAttributes} searchableAttributes Array of strings that contains searchable attributes sorted by order of importance(most to least important)
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -325,2 +418,3 @@ updateSearchableAttributes(searchableAttributes: SearchableAttributes): Promise<EnqueuedUpdate>;

* @method resetSearchableAttributes
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -332,2 +426,3 @@ resetSearchableAttributes(): Promise<EnqueuedUpdate>;

* @method getDisplayedAttributes
* @returns {Promise<string[]>} Promise containing array of displayed-attributes
*/

@@ -339,2 +434,4 @@ getDisplayedAttributes(): Promise<string[]>;

* @method updateDisplayedAttributes
* @param {DisplayedAttributes} displayedAttributes Array of strings that contains attributes of an index to display
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -346,2 +443,3 @@ updateDisplayedAttributes(displayedAttributes: DisplayedAttributes): Promise<EnqueuedUpdate>;

* @method resetDisplayedAttributes
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -348,0 +446,0 @@ resetDisplayedAttributes(): Promise<EnqueuedUpdate>;

@@ -7,2 +7,6 @@ import { Index } from './indexes';

httpRequest: HttpRequests;
/**
* Creates new MeiliSearch instance
* @param {Config} config Configuration object
*/
constructor(config: Config);

@@ -13,2 +17,5 @@ /**

* @method index
* @template T
* @param {string} indexUid The index UID
* @returns {Index<T>} Instance of Index
*/

@@ -21,2 +28,5 @@ index<T = any>(indexUid: string): Index<T>;

* @method getIndex
* @template T
* @param {string} indexUid The index UID
* @returns {Promise<Index<T>>} Promise containing Index instance
*/

@@ -29,2 +39,4 @@ getIndex<T = any>(indexUid: string): Promise<Index<T>>;

* @method getRawIndex
* @param {string} indexUid The index UID
* @returns {Promise<IndexResponse>} Promise containing index information
*/

@@ -36,2 +48,6 @@ getRawIndex(indexUid: string): Promise<IndexResponse>;

* @method getOrCreateIndex
* @template T
* @param {string} uid The index UID
* @param {IndexOptions} options Index options
* @returns {Promise<Index<T>>} Promise containing Index instance
*/

@@ -43,2 +59,3 @@ getOrCreateIndex<T = any>(uid: string, options?: IndexOptions): Promise<Index<T>>;

* @method getIndexes
* @returns {Promise<IndexResponse[]>} Promise containing array of raw index information
*/

@@ -50,2 +67,6 @@ getIndexes(): Promise<IndexResponse[]>;

* @method createIndex
* @template T
* @param {string} uid The index UID
* @param {IndexOptions} options Index options
* @returns {Promise<Index<T>>} Promise containing Index instance
*/

@@ -57,2 +78,6 @@ createIndex<T = any>(uid: string, options?: IndexOptions): Promise<Index<T>>;

* @method updateIndex
* @template T
* @param {string} uid The index UID
* @param {IndexOptions} options Index options to update
* @returns {Promise<Index<T>>} Promise containing Index instance after updating
*/

@@ -64,2 +89,4 @@ updateIndex<T = any>(uid: string, options?: IndexOptions): Promise<Index<T>>;

* @method deleteIndex
* @param {string} uid The index UID
* @returns {Promise<void>} Promise which resolves when index is deleted successfully
*/

@@ -71,2 +98,4 @@ deleteIndex(uid: string): Promise<void>;

* @method deleteIndexIfExists
* @param {string} uid The index UID
* @returns {Promise<boolean>} Promise which resolves to true when index exists and is deleted successfully, otherwise false if it does not exist
*/

@@ -78,2 +107,3 @@ deleteIndexIfExists(uid: string): Promise<boolean>;

* @method getKey
* @returns {Promise<Keys>} Promise containing an object with keys
*/

@@ -83,5 +113,5 @@ getKeys(): Promise<Keys>;

* Checks if the server is healthy, otherwise an error will be thrown.
*
* @memberof MeiliSearch
* @method health
* @returns {Promise<Health>} Promise containing an object with health details
*/

@@ -91,5 +121,5 @@ health(): Promise<Health>;

* Checks if the server is healthy, return true or false.
*
* @memberof MeiliSearch
* @method isHealthy
* @returns {Promise<boolean>} Promise containing a boolean
*/

@@ -101,2 +131,3 @@ isHealthy(): Promise<boolean>;

* @method getStats
* @returns {Promise<Stats>} Promise containing object of all the stats
*/

@@ -108,2 +139,3 @@ getStats(): Promise<Stats>;

* @method getVersion
* @returns {Promise<Version>} Promise containing object with version details
*/

@@ -115,2 +147,3 @@ getVersion(): Promise<Version>;

* @method createDump
* @returns {Promise<EnqueuedDump>} Promise containing object of the enqueued update
*/

@@ -122,2 +155,4 @@ createDump(): Promise<EnqueuedDump>;

* @method getDumpStatus
* @param {string} dumpUid Dump UID
* @returns {Promise<EnqueuedDump>} Promise containing object of the enqueued update
*/

@@ -124,0 +159,0 @@ getDumpStatus(dumpUid: string): Promise<EnqueuedDump>;

@@ -140,2 +140,6 @@ export declare type Config = {

};
export declare type WaitForPendingUpdateOptions = {
timeOutMs?: number;
intervalMs?: number;
};
export declare type Health = {

@@ -142,0 +146,0 @@ status: 'available';

{
"name": "meilisearch",
"version": "0.22.1",
"version": "0.22.2",
"description": "The MeiliSearch JS client for Node.js and the browser.",

@@ -71,7 +71,7 @@ "keywords": [

"devDependencies": {
"@babel/preset-env": "^7.15.6",
"@babel/preset-env": "^7.15.8",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "21.0.0",
"@rollup/plugin-commonjs": "21.0.1",
"@rollup/plugin-json": "^4.0.2",
"@rollup/plugin-node-resolve": "13.0.5",
"@rollup/plugin-node-resolve": "13.0.6",
"@types/jest": "^27.0.2",

@@ -105,4 +105,4 @@ "@types/prettier": "^2.2.3",

"ts-jest": "^26.5.6",
"typescript": "4.4.3"
"typescript": "4.4.4"
}
}

@@ -64,10 +64,13 @@ <p align="center">

For example, if you use Docker:
For example, using the `curl` command in [your Terminal](https://itconnect.uw.edu/learn/workshops/online-tutorials/web-publishing/what-is-a-terminal/):
```bash
docker pull getmeili/meilisearch:latest # Fetch the latest version of MeiliSearch image from Docker Hub
docker run -it --rm -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey
# Install MeiliSearch
curl -L https://install.meilisearch.com | sh
# Launch MeiliSearch
./meilisearch --master-key=masterKey
```
NB: you can also download MeiliSearch from **Homebrew** or **APT**.
NB: you can also download MeiliSearch from **Homebrew** or **APT** or even run it using **Docker**.

@@ -235,2 +238,45 @@ ### Import <!-- omit in toc -->

#### Custom Search With Filters <!-- omit in toc -->
If you want to enable filtering, you must add your attributes to the `filterableAttributes` index setting.
```js
await index.updateAttributesForFaceting([
'id',
'genres'
])
```
You only need to perform this operation once.
Note that MeiliSearch will rebuild your index whenever you update `filterableAttributes`. Depending on the size of your dataset, this might take time. You can track the process using the [update status](https://docs.meilisearch.com/reference/api/updates.html#get-an-update-status).
Then, you can perform the search:
```js
await index.search(
'wonder',
{
filter: ['id > 1 AND genres = Action']
}
)
```
```json
{
"hits": [
{
"id": 2,
"title": "Wonder Woman",
"genres": ["Action","Adventure"]
}
],
"offset": 0,
"limit": 20,
"nbHits": 1,
"processingTimeMs": 0,
"query": "wonder"
}
```
#### Placeholder Search <!-- omit in toc -->

@@ -237,0 +283,0 @@

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

DisplayedAttributes,
WaitForPendingUpdateOptions,
} from '../types'

@@ -46,2 +47,7 @@ import { sleep, removeUndefinedFromObject } from './utils'

/**
* @param {Config} config Request configuration options
* @param {string} uid UID of the index
* @param {string} primaryKey? Primary Key of the index
*/
constructor(config: Config, uid: string, primaryKey?: string) {

@@ -57,8 +63,11 @@ this.uid = uid

/**
* Waits for a pending update till it has been processed
* @param {number} updateId Update identifier
* @param {WaitForPendingUpdateOptions} options Additional configuration options
* @returns {Promise<Update>} Promise containing Update object after it has been processed
*/
async waitForPendingUpdate(
updateId: number,
{
timeOutMs = 5000,
intervalMs = 50,
}: { timeOutMs?: number; intervalMs?: number } = {}
{ timeOutMs = 5000, intervalMs = 50 }: WaitForPendingUpdateOptions = {}
): Promise<Update> {

@@ -84,2 +93,7 @@ const startingTime = Date.now()

* @method search
* @template T
* @param {string | null} query? Query string
* @param {SearchParams} options? Search options
* @param {Partial<Request>} config? Additional request configuration options
* @returns {Promise<SearchResponse<T>>} Promise containing the search response
*/

@@ -105,2 +119,7 @@ async search<T = Record<string, any>>(

* @method search
* @template T
* @param {string | null} query? Query string
* @param {SearchParams} options? Search options
* @param {Partial<Request>} config? Additional request configuration options
* @returns {Promise<SearchResponse<T>>} Promise containing the search response
*/

@@ -157,2 +176,3 @@ async searchGet<T = Record<string, any>>(

* @method getRawInfo
* @returns {Promise<IndexResponse>} Promise containing index information
*/

@@ -170,2 +190,3 @@ async getRawInfo(): Promise<IndexResponse> {

* @method fetchInfo
* @returns {Promise<this>} Promise to the current Index object with updated information
*/

@@ -181,2 +202,3 @@ async fetchInfo(): Promise<this> {

* @method fetchPrimaryKey
* @returns {Promise<string | undefined>} Promise containing the Primary Key of the index
*/

@@ -192,2 +214,7 @@ async fetchPrimaryKey(): Promise<string | undefined> {

* @method create
* @template T
* @param {string} uid Unique identifier of the Index
* @param {IndexOptions} options Index options
* @param {Config} config Request configuration options
* @returns {Promise<Index<T>>} Newly created Index object
*/

@@ -209,2 +236,4 @@ static async create<T = Record<string, any>>(

* @method update
* @param {IndexOptions} data Data to update
* @returns {Promise<this>} Promise to the current Index object with updated information
*/

@@ -222,2 +251,3 @@ async update(data: IndexOptions): Promise<this> {

* @method delete
* @returns {Promise<void>} Promise which resolves when index is deleted successfully
*/

@@ -233,2 +263,3 @@ async delete(): Promise<void> {

* @method deleteIfExists
* @returns {Promise<boolean>} Promise which resolves to true when index exists and is deleted successfully, otherwise false if it does not exist
*/

@@ -255,2 +286,3 @@ async deleteIfExists(): Promise<boolean> {

* @method getAllUpdateStatus
* @returns {Promise<Update[]>} Promise containing array of Update objects
*/

@@ -266,2 +298,4 @@ async getAllUpdateStatus(): Promise<Update[]> {

* @method getUpdateStatus
* @param {number} updateId Update identifier
* @returns {Promise<Update>} Promise containing the requested Update object
*/

@@ -281,2 +315,3 @@ async getUpdateStatus(updateId: number): Promise<Update> {

* @method getStats
* @returns {Promise<IndexStats>} Promise containing object with stats of the index
*/

@@ -295,2 +330,5 @@ async getStats(): Promise<IndexStats> {

* @method getDocuments
* @template T
* @param {GetDocumentsParams<T>} options? Options to browse the documents
* @returns {Promise<GetDocumentsResponse<T>>} Promise containing Document responses
*/

@@ -316,2 +354,5 @@ async getDocuments<T = Record<string, any>>(

* @method getDocument
* @template T
* @param {string | number} documentId Document ID
* @returns {Promise<Document<T>>} Promise containing Document response
*/

@@ -327,2 +368,6 @@ async getDocument(documentId: string | number): Promise<Document<T>> {

* @method addDocuments
* @template T
* @param {Array<Document<T>>} documents Array of Document objects to add/replace
* @param {AddDocumentParams} options? Query parameters
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -341,2 +386,7 @@ async addDocuments(

* @method addDocumentsInBatches
* @template T
* @param {Array<Document<T>>} documents Array of Document objects to add/replace
* @param {number} batchSize Size of the batch
* @param {AddDocumentParams} options? Query parameters
* @returns {Promise<EnqueuedUpdate[]>} Promise containing array of enqueued update objects for each batch
*/

@@ -361,2 +411,5 @@ async addDocumentsInBatches(

* @method updateDocuments
* @param {Array<Document<T>>} documents Array of Document objects to add/update
* @param {AddDocumentParams} options? Query parameters
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -375,2 +428,7 @@ async updateDocuments(

* @method updateDocuments
* @template T
* @param {Array<Document<T>>} documents Array of Document objects to add/update
* @param {number} batchSize Size of the batch
* @param {AddDocumentParams} options? Query parameters
* @returns {Promise<EnqueuedUpdate[]>} Promise containing array of enqueued update objects for each batch
*/

@@ -395,2 +453,4 @@ async updateDocumentsInBatches(

* @method deleteDocument
* @param {string | number} documentId Id of Document to delete
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -406,2 +466,4 @@ async deleteDocument(documentId: string | number): Promise<EnqueuedUpdate> {

* @method deleteDocuments
* @param {string[] | number[]} documentsIds Array of Document Ids to delete
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -420,2 +482,3 @@ async deleteDocuments(

* @method deleteAllDocuments
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -435,2 +498,3 @@ async deleteAllDocuments(): Promise<EnqueuedUpdate> {

* @method getSettings
* @returns {Promise<Settings>} Promise containing Settings object
*/

@@ -447,2 +511,4 @@ async getSettings(): Promise<Settings> {

* @method updateSettings
* @param {Settings} settings Object containing parameters with their updated values
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -458,2 +524,3 @@ async updateSettings(settings: Settings): Promise<EnqueuedUpdate> {

* @method resetSettings
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -473,2 +540,3 @@ async resetSettings(): Promise<EnqueuedUpdate> {

* @method getSynonyms
* @returns {Promise<object>} Promise containing object of synonym mappings
*/

@@ -484,2 +552,4 @@ async getSynonyms(): Promise<object> {

* @method updateSynonyms
* @param {Synonyms} synonyms Mapping of synonyms with their associated words
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -495,2 +565,3 @@ async updateSynonyms(synonyms: Synonyms): Promise<EnqueuedUpdate> {

* @method resetSynonyms
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -510,2 +581,3 @@ async resetSynonyms(): Promise<EnqueuedUpdate> {

* @method getStopWords
* @returns {Promise<string[]>} Promise containing array of stop-words
*/

@@ -521,2 +593,4 @@ async getStopWords(): Promise<string[]> {

* @method updateStopWords
* @param {StopWords} stopWords Array of strings that contains the stop-words.
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -532,2 +606,3 @@ async updateStopWords(stopWords: StopWords): Promise<EnqueuedUpdate> {

* @method resetStopWords
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -547,2 +622,3 @@ async resetStopWords(): Promise<EnqueuedUpdate> {

* @method getRankingRules
* @returns {Promise<string[]} Promise containing array of ranking-rules
*/

@@ -558,2 +634,4 @@ async getRankingRules(): Promise<string[]> {

* @method updateRankingRules
* @param {RankingRules} rankingRules Array that contain ranking rules sorted by order of importance.
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -571,2 +649,3 @@ async updateRankingRules(

* @method resetRankingRules
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -586,2 +665,3 @@ async resetRankingRules(): Promise<EnqueuedUpdate> {

* @method getDistinctAttribute
* @returns {Promise<string | null>} Promise containing the distinct-attribute of the index
*/

@@ -597,2 +677,4 @@ async getDistinctAttribute(): Promise<string | null> {

* @method updateDistinctAttribute
* @param {DistinctAttribute} distinctAttribute Field name of the distinct-attribute
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -610,2 +692,3 @@ async updateDistinctAttribute(

* @method resetDistinctAttribute
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -625,2 +708,3 @@ async resetDistinctAttribute(): Promise<EnqueuedUpdate> {

* @method getFilterableAttributes
* @returns {Promise<string[]>} Promise containing an array of filterable-attributes
*/

@@ -636,2 +720,4 @@ async getFilterableAttributes(): Promise<string[]> {

* @method updateFilterableAttributes
* @param {FilterableAttributes} filterableAttributes Array of strings containing the attributes that can be used as filters at query time
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -649,2 +735,3 @@ async updateFilterableAttributes(

* @method resetFilterableAttributes
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -664,2 +751,3 @@ async resetFilterableAttributes(): Promise<EnqueuedUpdate> {

* @method getSortableAttributes
* @returns {Promise<string[]>} Promise containing array of sortable-attributes
*/

@@ -675,2 +763,4 @@ async getSortableAttributes(): Promise<string[]> {

* @method updateSortableAttributes
* @param {SortableAttributes} sortableAttributes Array of strings containing the attributes that can be used to sort search results at query time
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -688,2 +778,3 @@ async updateSortableAttributes(

* @method resetSortableAttributes
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -703,2 +794,3 @@ async resetSortableAttributes(): Promise<EnqueuedUpdate> {

* @method getSearchableAttributes
* @returns {Promise<string[]>} Promise containing array of searchable-attributes
*/

@@ -714,2 +806,4 @@ async getSearchableAttributes(): Promise<string[]> {

* @method updateSearchableAttributes
* @param {SearchableAttributes} searchableAttributes Array of strings that contains searchable attributes sorted by order of importance(most to least important)
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -727,2 +821,3 @@ async updateSearchableAttributes(

* @method resetSearchableAttributes
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -742,2 +837,3 @@ async resetSearchableAttributes(): Promise<EnqueuedUpdate> {

* @method getDisplayedAttributes
* @returns {Promise<string[]>} Promise containing array of displayed-attributes
*/

@@ -753,2 +849,4 @@ async getDisplayedAttributes(): Promise<string[]> {

* @method updateDisplayedAttributes
* @param {DisplayedAttributes} displayedAttributes Array of strings that contains attributes of an index to display
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -766,2 +864,3 @@ async updateDisplayedAttributes(

* @method resetDisplayedAttributes
* @returns {Promise<EnqueuedUpdate>} Promise containing object of the enqueued update
*/

@@ -768,0 +867,0 @@ async resetDisplayedAttributes(): Promise<EnqueuedUpdate> {

@@ -29,2 +29,6 @@ /*

/**
* Creates new MeiliSearch instance
* @param {Config} config Configuration object
*/
constructor(config: Config) {

@@ -41,2 +45,5 @@ config.host = addProtocolIfNotPresent(config.host)

* @method index
* @template T
* @param {string} indexUid The index UID
* @returns {Index<T>} Instance of Index
*/

@@ -52,2 +59,5 @@ index<T = any>(indexUid: string): Index<T> {

* @method getIndex
* @template T
* @param {string} indexUid The index UID
* @returns {Promise<Index<T>>} Promise containing Index instance
*/

@@ -63,2 +73,4 @@ async getIndex<T = any>(indexUid: string): Promise<Index<T>> {

* @method getRawIndex
* @param {string} indexUid The index UID
* @returns {Promise<IndexResponse>} Promise containing index information
*/

@@ -73,2 +85,6 @@ async getRawIndex(indexUid: string): Promise<IndexResponse> {

* @method getOrCreateIndex
* @template T
* @param {string} uid The index UID
* @param {IndexOptions} options Index options
* @returns {Promise<Index<T>>} Promise containing Index instance
*/

@@ -100,2 +116,3 @@ async getOrCreateIndex<T = any>(

* @method getIndexes
* @returns {Promise<IndexResponse[]>} Promise containing array of raw index information
*/

@@ -111,2 +128,6 @@ async getIndexes(): Promise<IndexResponse[]> {

* @method createIndex
* @template T
* @param {string} uid The index UID
* @param {IndexOptions} options Index options
* @returns {Promise<Index<T>>} Promise containing Index instance
*/

@@ -124,2 +145,6 @@ async createIndex<T = any>(

* @method updateIndex
* @template T
* @param {string} uid The index UID
* @param {IndexOptions} options Index options to update
* @returns {Promise<Index<T>>} Promise containing Index instance after updating
*/

@@ -137,2 +162,4 @@ async updateIndex<T = any>(

* @method deleteIndex
* @param {string} uid The index UID
* @returns {Promise<void>} Promise which resolves when index is deleted successfully
*/

@@ -147,2 +174,4 @@ async deleteIndex(uid: string): Promise<void> {

* @method deleteIndexIfExists
* @param {string} uid The index UID
* @returns {Promise<boolean>} Promise which resolves to true when index exists and is deleted successfully, otherwise false if it does not exist
*/

@@ -169,2 +198,3 @@ async deleteIndexIfExists(uid: string): Promise<boolean> {

* @method getKey
* @returns {Promise<Keys>} Promise containing an object with keys
*/

@@ -182,5 +212,5 @@ async getKeys(): Promise<Keys> {

* Checks if the server is healthy, otherwise an error will be thrown.
*
* @memberof MeiliSearch
* @method health
* @returns {Promise<Health>} Promise containing an object with health details
*/

@@ -194,5 +224,5 @@ async health(): Promise<Health> {

* Checks if the server is healthy, return true or false.
*
* @memberof MeiliSearch
* @method isHealthy
* @returns {Promise<boolean>} Promise containing a boolean
*/

@@ -217,2 +247,3 @@ async isHealthy(): Promise<boolean> {

* @method getStats
* @returns {Promise<Stats>} Promise containing object of all the stats
*/

@@ -232,2 +263,3 @@ async getStats(): Promise<Stats> {

* @method getVersion
* @returns {Promise<Version>} Promise containing object with version details
*/

@@ -247,2 +279,3 @@ async getVersion(): Promise<Version> {

* @method createDump
* @returns {Promise<EnqueuedDump>} Promise containing object of the enqueued update
*/

@@ -258,2 +291,4 @@ async createDump(): Promise<EnqueuedDump> {

* @method getDumpStatus
* @param {string} dumpUid Dump UID
* @returns {Promise<EnqueuedDump>} Promise containing object of the enqueued update
*/

@@ -260,0 +295,0 @@ async getDumpStatus(dumpUid: string): Promise<EnqueuedDump> {

@@ -186,2 +186,7 @@ // Type definitions for meilisearch

export type WaitForPendingUpdateOptions = {
timeOutMs?: number
intervalMs?: number
}
/*

@@ -188,0 +193,0 @@ *** HEALTH

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc