New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

meilisearch

Package Overview
Dependencies
Maintainers
0
Versions
99
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.46.0 to 0.47.0

dist/types/batch.d.ts

4

CONTRIBUTING.md

@@ -37,6 +37,6 @@ # Contributing

- Node.js >= v14 and node <= 18
- Node.js >= v16 and node <= 18
- Yarn
- vitest
### Setup

@@ -43,0 +43,0 @@

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

// Type definitions for meilisearch 0.46.0
// Type definitions for meilisearch 0.47.0
// Project: https://github.com/meilisearch/meilisearch-js

@@ -3,0 +3,0 @@ // Definitions by: cvermand <charlotte@meilisearch.com> <https://github.com/meilisearch>

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

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

@@ -605,4 +605,42 @@ import { Task, TaskClient } from "./task";

resetLocalizedAttributes(): Promise<EnqueuedTask>;
/**
* Get the facet search settings.
*
* @returns Promise containing object of facet search settings
*/
getFacetSearch(): Promise<boolean>;
/**
* Update the facet search settings.
*
* @param facetSearch - Boolean value
* @returns Promise containing an EnqueuedTask
*/
updateFacetSearch(facetSearch: boolean): Promise<EnqueuedTask>;
/**
* Reset the facet search settings.
*
* @returns Promise containing an EnqueuedTask
*/
resetFacetSearch(): Promise<EnqueuedTask>;
/**
* Get the prefix search settings.
*
* @returns Promise containing object of prefix search settings
*/
getPrefixSearch(): Promise<PrefixSearch>;
/**
* Update the prefix search settings.
*
* @param prefixSearch - PrefixSearch value
* @returns Promise containing an EnqueuedTask
*/
updatePrefixSearch(prefixSearch: PrefixSearch): Promise<EnqueuedTask>;
/**
* Reset the prefix search settings.
*
* @returns Promise containing an EnqueuedTask
*/
resetPrefixSearch(): Promise<EnqueuedTask>;
}
export { Index };
//# sourceMappingURL=indexes.d.ts.map
import { Index } from "./indexes";
import { KeyCreation, Config, IndexOptions, IndexObject, Key, Health, Stats, Version, TasksQuery, WaitOptions, KeyUpdate, IndexesQuery, IndexesResults, KeysQuery, KeysResults, TasksResults, SwapIndexesParams, CancelTasksQuery, DeleteTasksQuery, MultiSearchParams, FederatedMultiSearchParams, MultiSearchResponseOrSearchResponse } from "./types";
import { KeyCreation, Config, IndexOptions, IndexObject, Key, Health, Stats, Version, TasksQuery, WaitOptions, KeyUpdate, IndexesQuery, IndexesResults, KeysQuery, KeysResults, TasksResults, SwapIndexesParams, CancelTasksQuery, DeleteTasksQuery, MultiSearchParams, FederatedMultiSearchParams, BatchesResults, BatchesQuery, MultiSearchResponseOrSearchResponse } from "./types";
import { HttpRequests } from "./http-requests";
import { TaskClient, Task } from "./task";
import { EnqueuedTask } from "./enqueued-task";
import { Batch, BatchClient } from "./batch";
export declare class MeiliSearch {

@@ -10,2 +11,3 @@ config: Config;

tasks: TaskClient;
batches: BatchClient;
/**

@@ -159,2 +161,16 @@ * Creates new MeiliSearch instance

/**
* Get all the batches
*
* @param parameters - Parameters to browse the batches
* @returns Promise returning all batches
*/
getBatches(parameters?: BatchesQuery): Promise<BatchesResults>;
/**
* Get one batch
*
* @param uid - Batch identifier
* @returns Promise returning a batch
*/
getBatch(uid: number): Promise<Batch>;
/**
* Get all API keys

@@ -161,0 +177,0 @@ *

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

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

@@ -9,2 +9,3 @@ import { Config, WaitOptions, TasksQuery, TasksResults, TaskObject, CancelTasksQuery, DeleteTasksQuery } from "./types";

uid: TaskObject["uid"];
batchUid: TaskObject["batchUid"];
canceledBy: TaskObject["canceledBy"];

@@ -11,0 +12,0 @@ details: TaskObject["details"];

import { Task } from "../task";
import { Batch } from "../batch";
export type Config = {

@@ -138,2 +139,3 @@ host: string;

length: number;
indices?: number[];
}>>>;

@@ -357,2 +359,3 @@ export type RankingScoreDetails = {

export type LocalizedAttributes = LocalizedAttribute[] | null;
export type PrefixSearch = "indexingTime" | "disabled";
export type Settings = {

@@ -377,2 +380,12 @@ filterableAttributes?: FilterableAttributes;

localizedAttributes?: LocalizedAttributes;
/**
* Enable facet searching on all the filters of an index (requires Meilisearch
* 1.12.0 or later)
*/
facetSearch?: boolean;
/**
* Enable the ability to search a word by prefix on an index (requires
* Meilisearch 1.12.0 or later)
*/
prefixSearch?: "indexingTime" | "disabled";
};

@@ -415,2 +428,7 @@ export declare const TaskStatus: {

from?: number;
/**
* If true, the tasks are returned in reverse order (requires Meilisearch
* 1.12.0 or later)
*/
reverse?: boolean;
};

@@ -429,2 +447,4 @@ export type CancelTasksQuery = Omit<TasksQuery, "limit" | "from"> & {};

uid: number;
/** The UID of the batch that the task belongs to (`null` for enqueued tasks) */
batchUid: number | null;
details: {

@@ -471,2 +491,83 @@ receivedDocuments?: number;

};
/**
* Represents a batch operation object containing information about tasks
* processing
*/
export type BatchObject = {
/** Unique identifier for the batch */
uid: number;
/** Details about document processing */
details: {
/** Number of documents received in the batch */
receivedDocuments?: number;
/** Number of documents successfully indexed */
indexedDocuments?: number;
/** Number of documents deleted in the batch */
deletedDocuments?: number;
};
/** Progress and indexing step of the batch, null if the batch is finished */
progress: null | {
/** An array of all the steps currently being processed */
steps: Array<{
/**
* A string representing the name of the current step NOT stable. Only use
* for debugging purposes.
*/
currentStep: string;
/** Number of finished tasks */
finished: number;
/** Total number of tasks to finish before moving to the next step */
total: number;
}>;
/** Percentage of progression of all steps currently being processed */
percentage: number;
};
/** Statistics about tasks within the batch */
stats: {
/** Total number of tasks in the batch */
totalNbTasks: number;
/** Count of tasks in each status */
status: {
/** Number of successfully completed tasks */
succeeded: number;
/** Number of failed tasks */
failed: number;
/** Number of canceled tasks */
canceled: number;
/** Number of tasks currently processing */
processing: number;
/** Number of tasks waiting to be processed */
enqueued: number;
};
/** Count of tasks by type */
types: Record<TaskTypes, number>;
/** Count of tasks by index UID */
indexUids: Record<string, number>;
};
/** Timestamp when the batch started processing (rfc3339 format) */
startedAt: string;
/** Timestamp when the batch finished processing (rfc3339 format) */
finishedAt: string;
/** Duration of batch processing */
duration: string;
};
export type BatchesQuery = {
/** The batch should contain the specified task UIDs */
uids?: number[];
batchUids?: number[];
types?: TaskTypes[];
statuses?: TaskStatus[];
indexUids?: string[];
canceledBy?: number[];
beforeEnqueuedAt?: Date;
afterEnqueuedAt?: Date;
beforeStartedAt?: Date;
afterStartedAt?: Date;
beforeFinishedAt?: Date;
afterFinishedAt?: Date;
limit?: number;
from?: number;
};
export type BatchesResults = CursorResults<Batch>;
export type BatchesResultsObject = CursorResults<BatchObject>;
export type Health = {

@@ -473,0 +574,0 @@ status: "available";

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

@@ -5,0 +5,0 @@ "keywords": [

@@ -568,2 +568,16 @@ <p align="center">

### Batches <!-- omit in toc -->
#### [Get one batch](https://www.meilisearch.com/docs/reference/api/batches#get-one-batch)
```ts
client.getBatch(uid: number): Promise<Batch>
```
#### [Get all batches](https://www.meilisearch.com/docs/reference/api/batchess#get-batches)
```ts
client.getBatches(parameters: BatchesQuery = {}): Promise<BatchesResults>
```
### Indexes <!-- omit in toc -->

@@ -985,2 +999,42 @@

### Facet search settings <!-- omit in toc -->
#### [Get facet search settings](https://www.meilisearch.com/docs/reference/api/settings#get-facet-search-settings)
```ts
client.index('myIndex').getFacetSearch(): Promise<boolean>
```
#### [Update facet search settings](https://www.meilisearch.com/docs/reference/api/settings#update-facet-search-settings)
```ts
client.index('myIndex').updateFacetSearch(enabled: boolean): Promise<EnqueuedTask>
```
#### [Reset facet search settings](https://www.meilisearch.com/docs/reference/api/settings#reset-facet-search-settings)
```ts
client.index('myIndex').resetFacetSearch(): Promise<EnqueuedTask>
```
### Prefix search settings <!-- omit in toc -->
#### [Get prefix search settings](https://www.meilisearch.com/docs/reference/api/settings#get-prefix-search-settings)
```ts
client.index('myIndex').getPrefixSearch(): Promise<PrefixSearch>
```
#### [Update prefix search settings](https://www.meilisearch.com/docs/reference/api/settings#update-prefix-search-settings)
```ts
client.index('myIndex').updatePrefixSearch(prefixSearch: PrefixSearch): Promise<EnqueuedTask>
```
#### [Reset prefix search settings](https://www.meilisearch.com/docs/reference/api/settings#reset-prefix-search-settings)
```ts
client.index('myIndex').resetPrefixSearch(): Promise<EnqueuedTask>
```
### Embedders <!-- omit in toc -->

@@ -987,0 +1041,0 @@

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

UpdateDocumentsByFunctionOptions,
PrefixSearch,
} from "./types";

@@ -1461,4 +1462,78 @@ import { removeUndefinedFromObject } from "./utils";

}
///
/// FACET SEARCH SETTINGS
///
/**
* Get the facet search settings.
*
* @returns Promise containing object of facet search settings
*/
async getFacetSearch(): Promise<boolean> {
const url = `indexes/${this.uid}/settings/facet-search`;
return await this.httpRequest.get<boolean>(url);
}
/**
* Update the facet search settings.
*
* @param facetSearch - Boolean value
* @returns Promise containing an EnqueuedTask
*/
async updateFacetSearch(facetSearch: boolean): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/facet-search`;
const task = await this.httpRequest.put(url, facetSearch);
return new EnqueuedTask(task);
}
/**
* Reset the facet search settings.
*
* @returns Promise containing an EnqueuedTask
*/
async resetFacetSearch(): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/facet-search`;
const task = await this.httpRequest.delete(url);
return new EnqueuedTask(task);
}
///
/// PREFIX SEARCH SETTINGS
///
/**
* Get the prefix search settings.
*
* @returns Promise containing object of prefix search settings
*/
async getPrefixSearch(): Promise<PrefixSearch> {
const url = `indexes/${this.uid}/settings/prefix-search`;
return await this.httpRequest.get<PrefixSearch>(url);
}
/**
* Update the prefix search settings.
*
* @param prefixSearch - PrefixSearch value
* @returns Promise containing an EnqueuedTask
*/
async updatePrefixSearch(prefixSearch: PrefixSearch): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/prefix-search`;
const task = await this.httpRequest.put(url, prefixSearch);
return new EnqueuedTask(task);
}
/**
* Reset the prefix search settings.
*
* @returns Promise containing an EnqueuedTask
*/
async resetPrefixSearch(): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/prefix-search`;
const task = await this.httpRequest.delete(url);
return new EnqueuedTask(task);
}
}
export { Index };

@@ -33,2 +33,4 @@ /*

FederatedMultiSearchParams,
BatchesResults,
BatchesQuery,
MultiSearchResponseOrSearchResponse,

@@ -39,2 +41,3 @@ } from "./types";

import { EnqueuedTask } from "./enqueued-task";
import { Batch, BatchClient } from "./batch";

@@ -45,2 +48,3 @@ export class MeiliSearch {

tasks: TaskClient;
batches: BatchClient;

@@ -56,2 +60,3 @@ /**

this.tasks = new TaskClient(config);
this.batches = new BatchClient(config);
}

@@ -310,2 +315,22 @@

/**
* Get all the batches
*
* @param parameters - Parameters to browse the batches
* @returns Promise returning all batches
*/
async getBatches(parameters: BatchesQuery = {}): Promise<BatchesResults> {
return await this.batches.getBatches(parameters);
}
/**
* Get one batch
*
* @param uid - Batch identifier
* @returns Promise returning a batch
*/
async getBatch(uid: number): Promise<Batch> {
return await this.batches.getBatch(uid);
}
///

@@ -312,0 +337,0 @@ /// KEYS

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

export const PACKAGE_VERSION = "0.46.0";
export const PACKAGE_VERSION = "0.47.0";

@@ -22,2 +22,3 @@ import { MeiliSearchTimeOutError } from "./errors";

uid: TaskObject["uid"];
batchUid: TaskObject["batchUid"];
canceledBy: TaskObject["canceledBy"];

@@ -36,2 +37,3 @@ details: TaskObject["details"];

this.uid = task.uid;
this.batchUid = task.batchUid;
this.details = task.details;

@@ -38,0 +40,0 @@ this.canceledBy = task.canceledBy;

@@ -8,2 +8,3 @@ // Type definitions for meilisearch

import { Task } from "../task";
import { Batch } from "../batch";

@@ -189,3 +190,3 @@ export type Config = {

export type MatchesPosition<T> = Partial<
Record<keyof T, Array<{ start: number; length: number }>>
Record<keyof T, Array<{ start: number; length: number; indices?: number[] }>>
>;

@@ -496,2 +497,4 @@

export type PrefixSearch = "indexingTime" | "disabled";
export type Settings = {

@@ -516,2 +519,13 @@ filterableAttributes?: FilterableAttributes;

localizedAttributes?: LocalizedAttributes;
/**
* Enable facet searching on all the filters of an index (requires Meilisearch
* 1.12.0 or later)
*/
facetSearch?: boolean;
/**
* Enable the ability to search a word by prefix on an index (requires
* Meilisearch 1.12.0 or later)
*/
prefixSearch?: "indexingTime" | "disabled";
};

@@ -563,2 +577,7 @@

from?: number;
/**
* If true, the tasks are returned in reverse order (requires Meilisearch
* 1.12.0 or later)
*/
reverse?: boolean;
};

@@ -581,2 +600,4 @@

uid: number;
/** The UID of the batch that the task belongs to (`null` for enqueued tasks) */
batchUid: number | null;
details: {

@@ -664,2 +685,94 @@ // Number of documents sent

/*
** BATCHES
*/
/**
* Represents a batch operation object containing information about tasks
* processing
*/
export type BatchObject = {
/** Unique identifier for the batch */
uid: number;
/** Details about document processing */
details: {
/** Number of documents received in the batch */
receivedDocuments?: number;
/** Number of documents successfully indexed */
indexedDocuments?: number;
/** Number of documents deleted in the batch */
deletedDocuments?: number;
};
/** Progress and indexing step of the batch, null if the batch is finished */
progress: null | {
/** An array of all the steps currently being processed */
steps: Array<{
/**
* A string representing the name of the current step NOT stable. Only use
* for debugging purposes.
*/
currentStep: string;
/** Number of finished tasks */
finished: number;
/** Total number of tasks to finish before moving to the next step */
total: number;
}>;
/** Percentage of progression of all steps currently being processed */
percentage: number;
};
/** Statistics about tasks within the batch */
stats: {
/** Total number of tasks in the batch */
totalNbTasks: number;
/** Count of tasks in each status */
status: {
/** Number of successfully completed tasks */
succeeded: number;
/** Number of failed tasks */
failed: number;
/** Number of canceled tasks */
canceled: number;
/** Number of tasks currently processing */
processing: number;
/** Number of tasks waiting to be processed */
enqueued: number;
};
/** Count of tasks by type */
types: Record<TaskTypes, number>;
/** Count of tasks by index UID */
indexUids: Record<string, number>;
};
/** Timestamp when the batch started processing (rfc3339 format) */
startedAt: string;
/** Timestamp when the batch finished processing (rfc3339 format) */
finishedAt: string;
/** Duration of batch processing */
duration: string;
};
export type BatchesQuery = {
/** The batch should contain the specified task UIDs */
uids?: number[];
batchUids?: number[];
types?: TaskTypes[];
statuses?: TaskStatus[];
indexUids?: string[];
canceledBy?: number[];
beforeEnqueuedAt?: Date;
afterEnqueuedAt?: Date;
beforeStartedAt?: Date;
afterStartedAt?: Date;
beforeFinishedAt?: Date;
afterFinishedAt?: Date;
limit?: number;
from?: number;
};
export type BatchesResults = CursorResults<Batch>;
export type BatchesResultsObject = CursorResults<BatchObject>;
/*
*** HEALTH

@@ -666,0 +779,0 @@ */

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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