From 19cd7f213ea118530eed9aefbd1dd2c04e1d3ddd Mon Sep 17 00:00:00 2001 From: "F. Levi" <55688616+flevi29@users.noreply.github.com> Date: Wed, 22 Jan 2025 11:06:11 +0200 Subject: [PATCH 01/10] Refactor README --- CONTRIBUTING.md | 21 +- README.md | 1115 +---------------------------------------------- 2 files changed, 26 insertions(+), 1110 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 141fafb3a..4dbb7fefd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,7 @@ First of all, thank you for contributing to Meilisearch! The goal of this docume - [How to Contribute](#how-to-contribute) - [Development Workflow](#development-workflow) - [Git Guidelines](#git-guidelines) -- [Release Process (for internal team only)](#release-process-for-internal-team-only) +- [Release Process (for internal team only)](#release-process-for-the-internal-team-only) @@ -42,6 +42,7 @@ To run this project, you will need: You can set up your local environment natively or using `docker`, check out the [`docker-compose.yml`](/docker-compose.yml). Example of running all the checks with docker: + ```bash docker-compose run --rm package bash -c "yarn install && yarn test && yarn lint" ``` @@ -79,6 +80,7 @@ We do not enforce any branch naming style, but please use something descriptive ### Git Commits As minimal requirements, your commit message should: + - be capitalized - not finish by a dot or any other punctuation character (!,?) - start with a verb so that we can read your commit message this way: "This commit will ...", where "..." is the commit message. @@ -119,11 +121,13 @@ _[Read more about this](https://github.com/meilisearch/integration-guides/blob/m Make a PR modifying the following files with the right version: [`package.json`](/package.json): + ```javascript "version": "X.X.X", ``` [`src/package-version`](/src/package-version.ts) + ```javascript export const PACKAGE_VERSION = 'X.X.X' ``` @@ -137,6 +141,7 @@ GitHub Actions will be triggered and push the package to [npm](https://www.npmjs #### Release a `beta` Version This package is able to create multiple types of betas: + - A standard package beta, working on the latest version of Meilisearch. - A beta implementing the changes of a rc version of Meilisearch. - A beta implementing a specific feature `prototype` of Meilisearch. @@ -159,16 +164,16 @@ Here are the steps to release a beta version of this package depending on its ty 3. Commit and push your code to the newly created branch (step 1). - 4. Go to the [GitHub interface for releasing](https://github.com/meilisearch/meilisearch-js/releases): on this page, click on `Draft a new release`. 5. Create a GitHub pre-release: - - Fill the description with the detailed changelogs - - Fill the title with `vX.X.X-beta.0` - - Fill the tag with `vX.X.X-beta.0` - - ⚠️ Select the `vX.X.X-beta.0` branch and NOT `main` - - ⚠️ Click on the "This is a pre-release" checkbox - - Click on "Publish release" + +- Fill the description with the detailed changelogs +- Fill the title with `vX.X.X-beta.0` +- Fill the tag with `vX.X.X-beta.0` +- ⚠️ Select the `vX.X.X-beta.0` branch and NOT `main` +- ⚠️ Click on the "This is a pre-release" checkbox +- Click on "Publish release"
diff --git a/README.md b/README.md index 2a37f1642..3047c589f 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,7 @@

npm version Tests - - Codecov - + Codecov Prettier License Bors enabled @@ -31,33 +29,26 @@ **Meilisearch** is an open-source search engine. [Learn more about Meilisearch.](https://github.com/meilisearch/meilisearch) -## Table of Contents - -- [📖 Documentation](#-documentation) -- [🔧 Installation](#-installation) -- [🚀 Getting started](#-getting-started) -- [🤖 Compatibility with Meilisearch](#-compatibility-with-meilisearch) -- [💡 Learn more](#-learn-more) -- [⚙️ Contributing](#️-contributing) -- [📜 API resources](#-api-resources) - ## 📖 Documentation -This readme and [Meilisearch JS documentation website](https://meilisearch.github.io/meilisearch-js/) contains all the information you need to start using this Meilisearch SDK. +Refer to the [client library documentation](https://meilisearch.github.io/meilisearch-js/modules.html) for information on each exported item of this pacakge. For general information on how to use Meilisearch—such as our API reference, tutorials, guides, and in-depth articles—refer to our [main documentation website](https://www.meilisearch.com/docs/). ## 🔧 Installation -We recommend installing `meilisearch-js` in your project with your package manager of choice. - ```sh -npm install meilisearch +npm i meilisearch +# or +yarn add meilisearch +# or +pnpm add meilisearch ``` -`meilisearch-js` officially supports `node` versions 18 LTS and 20 LTS. + +Node.js [LTS and Maintenance versions](https://github.com/nodejs/Release?tab=readme-ov-file#release-schedule) should be tested and supported. -Instead of using a package manager, you may also import the library directly into your [HTML via a CDN](#include-script-tag). +Other runtimes, like Deno and Bun aren't tested, but if they do not work with this package, pelase open an issue. ### Run Meilisearch @@ -65,1098 +56,18 @@ Instead of using a package manager, you may also import the library directly int 🪨 Prefer to self-host? [Download and deploy](https://www.meilisearch.com/docs/learn/self_hosted/getting_started_with_self_hosted_meilisearch?utm_campaign=oss&utm_source=github&utm_medium=meilisearch-js) our fast, open-source search engine on your own infrastructure. -### Import - -After installing `meilisearch-js`, you must import it into your application. There are many ways of doing that depending on your development environment. - -> [!WARNING] -> - [default export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export#using_the_default_export) is deprecated and will be removed in a future version https://github.com/meilisearch/meilisearch-js/issues/1789 -> - exports will stop being directly available on the global object (usually `window`) https://github.com/meilisearch/meilisearch-js/issues/1806 - -#### `import` syntax - -Usage in an ES module environment: - -```javascript -import { MeiliSearch } from 'meilisearch' - -const client = new MeiliSearch({ - host: 'http://127.0.0.1:7700', - apiKey: 'masterKey', -}) -``` - -#### ` - -``` - -#### `require` syntax - -Usage in a back-end node.js or another environment supporting CommonJS modules: - -```javascript -const { MeiliSearch } = require('meilisearch') - -const client = new MeiliSearch({ - host: 'http://127.0.0.1:7700', - apiKey: 'masterKey', -}) -``` - -#### React Native - -To use `meilisearch-js` with React Native, you must also install [react-native-url-polyfill](https://www.npmjs.com/package/react-native-url-polyfill). - -#### Deno - -Usage in a Deno environment: - -```js -import { MeiliSearch } from "https://esm.sh/meilisearch" - -const client = new MeiliSearch({ - host: 'http://127.0.0.1:7700', - apiKey: 'masterKey', -}) -``` - -## 🚀 Getting started - -### Add documents - -```js -const { MeiliSearch } = require('meilisearch') -// Or if you are in a ES environment -import { MeiliSearch } from 'meilisearch' - -;(async () => { - const client = new MeiliSearch({ - host: 'http://127.0.0.1:7700', - apiKey: 'masterKey', - }) - - // An index is where the documents are stored. - const index = client.index('movies') - - const documents = [ - { id: 1, title: 'Carol', genres: ['Romance', 'Drama'] }, - { id: 2, title: 'Wonder Woman', genres: ['Action', 'Adventure'] }, - { id: 3, title: 'Life of Pi', genres: ['Adventure', 'Drama'] }, - { id: 4, title: 'Mad Max: Fury Road', genres: ['Adventure', 'Science Fiction'] }, - { id: 5, title: 'Moana', genres: ['Fantasy', 'Action']}, - { id: 6, title: 'Philadelphia', genres: ['Drama'] }, - ] - - // If the index 'movies' does not exist, Meilisearch creates it when you first add the documents. - let response = await index.addDocuments(documents) - - console.log(response) // => { "uid": 0 } -})() -``` - -Tasks such as document addition always return a unique identifier. You can use this identifier `taskUid` to check the status (`enqueued`, `canceled`, `processing`, `succeeded` or `failed`) of a [task](https://www.meilisearch.com/docs/reference/api/tasks). - -### Basic search - -```javascript -// Meilisearch is typo-tolerant: -const search = await index.search('philoudelphia') -console.log(search) -``` - -Output: - -```json -{ - "hits": [ - { - "id": "6", - "title": "Philadelphia", - "genres": ["Drama"] - } - ], - "offset": 0, - "limit": 20, - "estimatedTotalHits": 1, - "processingTimeMs": 1, - "query": "philoudelphia" -} -``` - -### Using search parameters - -`meilisearch-js` supports all [search parameters](https://www.meilisearch.com/docs/reference/api/search#search-parameters) described in our main documentation website. - -```javascript -await index.search( - 'wonder', - { - attributesToHighlight: ['*'] - } -) -``` - -```json -{ - "hits": [ - { - "id": 2, - "title": "Wonder Woman", - "genres": ["Action", "Adventure"], - "_formatted": { - "id": "2", - "title": "Wonder Woman", - "genres": ["Action", "Adventure"] - } - } - ], - "offset": 0, - "limit": 20, - "estimatedTotalHits": 1, - "processingTimeMs": 0, - "query": "wonder" -} -``` - -### Custom search with filters - -To enable filtering, you must first add your attributes to the [`filterableAttributes` index setting](https://www.meilisearch.com/docs/reference/api/settings#filterable-attributes). - -```js -await index.updateFilterableAttributes([ - 'id', - 'genres' - ]) -``` - -You only need to perform this operation once per index. - -Note that Meilisearch rebuilds your index whenever you update `filterableAttributes`. Depending on the size of your dataset, this might take considerable time. You can track the process using the [tasks API](https://www.meilisearch.com/docs/reference/api/tasks)). - -After you configured `filterableAttributes`, you can use the [`filter` search parameter](https://www.meilisearch.com/docs/reference/api/search#filter) to refine your 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, - "estimatedTotalHits": 1, - "processingTimeMs": 0, - "query": "wonder" -} -``` +## 🚀 Example code -### Placeholder search - -Placeholder search makes it possible to receive hits based on your parameters without having any query (`q`). For example, in a movies database you can run an empty query to receive all results filtered by `genre`. - -```javascript -await index.search( - '', - { - filter: ['genres = fantasy'], - facets: ['genres'] - } -) -``` - -```json -{ - "hits": [ - { - "id": 2, - "title": "Wonder Woman", - "genres": ["Action","Adventure"] - }, - { - "id": 5, - "title": "Moana", - "genres": ["Fantasy","Action"] - } - ], - "offset": 0, - "limit": 20, - "estimatedTotalHits": 2, - "processingTimeMs": 0, - "query": "", - "facetDistribution": { - "genres": { - "Action": 2, - "Fantasy": 1, - "Adventure": 1 - } - } -} -``` - -Note that to enable faceted search on your dataset you need to add `genres` to the `filterableAttributes` index setting. For more information on filtering and faceting, [consult our documentation settings](https://www.meilisearch.com/docs/learn/fine_tuning_results/faceted_search). - -#### Abortable search - -You can abort a pending search request by providing an [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) to the request. - -```js -const controller = new AbortController() - -index - .search('wonder', {}, { - signal: controller.signal, - }) - .then((response) => { - /** ... */ - }) - .catch((e) => { - /** Catch AbortError here. */ - }) - -controller.abort() -``` - - -### Using Meilisearch behind a proxy - -#### Custom request config - -You can provide a custom request configuration. for example, with custom headers. - -```ts -const client: MeiliSearch = new MeiliSearch({ - host: 'http://localhost:3000/api/meilisearch/proxy', - requestConfig: { - headers: { - Authorization: AUTH_TOKEN - }, - // OR - credentials: 'include' - } -}) -``` - -#### Custom http client - -You can use your own HTTP client, for example, with [`axios`](https://github.com/axios/axios). - -```ts -const client: MeiliSearch = new MeiliSearch({ - host: 'http://localhost:3000/api/meilisearch/proxy', - httpClient: async (url, opts) => { - const response = await $axios.request({ - url, - data: opts?.body, - headers: opts?.headers, - method: (opts?.method?.toLocaleUpperCase() as Method) ?? 'GET' - }) - - return response.data - } -}) -``` + ## 🤖 Compatibility with Meilisearch -This package guarantees compatibility with [version v1.x of Meilisearch](https://github.com/meilisearch/meilisearch/releases/latest), but some features may not be present. Please check the [issues](https://github.com/meilisearch/meilisearch-js/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+label%3Aenhancement) for more info. - -## 💡 Learn more - -The following sections in our main documentation website may interest you: - -- **Manipulate documents**: see the [API references](https://www.meilisearch.com/docs/reference/api/documents) or read more about [documents](https://www.meilisearch.com/docs/learn/core_concepts/documents). -- **Search**: see the [API references](https://www.meilisearch.com/docs/reference/api/search) or follow our guide on [search parameters](https://www.meilisearch.com/docs/reference/api/search#search-parameters). -- **Manage the indexes**: see the [API references](https://www.meilisearch.com/docs/reference/api/indexes) or read more about [indexes](https://www.meilisearch.com/docs/learn/core_concepts/indexes). -- **Configure the index settings**: see the [API references](https://www.meilisearch.com/docs/reference/api/settings) or follow our guide on [settings parameters](https://www.meilisearch.com/docs/reference/api/settings#settings_parameters). - -This repository also contains [more examples](./examples). +This package guarantees compatibility with the [latest version of Meilisearch](https://github.com/meilisearch/meilisearch/releases/latest). ## ⚙️ Contributing We welcome all contributions, big and small! If you want to know more about this SDK's development workflow or want to contribute to the repo, please visit our [contributing guidelines](/CONTRIBUTING.md) for detailed instructions. -## 📜 API resources - -### Search - -#### [Make a search request](https://www.meilisearch.com/docs/reference/api/search) - -```ts -client.index('xxx').search(query: string, options: SearchParams = {}, config?: Partial): Promise> -``` - -#### [Make a search request using the GET method (slower than the search method)](https://www.meilisearch.com/docs/reference/api/search#search-in-an-index-with-get-route) - -```ts -client.index('xxx').searchGet(query: string, options: SearchParams = {}, config?: Partial): Promise> -``` - -### Multi Search - -#### [Make multiple search requests](https://www.meilisearch.com/docs/reference/api/multi_search#multi-search) - -```ts -client.multiSearch(queries?: MultiSearchParams, config?: Partial): Promise>> -``` - -`multiSearch` uses the `POST` method when performing its request to Meilisearch. - -### Search For Facet Values - -#### [Search for facet values](https://www.meilisearch.com/docs/reference/api/facet_search#perform-a-facet-search) - -```ts -client.index('myIndex').searchForFacetValues(params: SearchForFacetValuesParams, config?: Partial): Promise -``` - -### Documents - -#### [Add or replace multiple documents](https://www.meilisearch.com/docs/reference/api/documents#add-or-replace-documents) - -```ts -client.index('myIndex').addDocuments(documents: Document[]): Promise -``` - -#### [Add or replace multiple documents in string format](https://www.meilisearch.com/docs/reference/api/documents#add-or-update-documents) - -```ts -client.index('myIndex').addDocumentsFromString(documents: string, contentType: ContentType, queryParams: RawDocumentAdditionOptions): Promise -``` - -#### [Add or replace multiple documents in batches](https://www.meilisearch.com/docs/reference/api/documents#add-or-replace-documents) - -```ts -client.index('myIndex').addDocumentsInBatches(documents: Document[], batchSize = 1000): Promise -``` - -#### [Add or update multiple documents](https://www.meilisearch.com/docs/reference/api/documents#add-or-update-documents) - -```ts -client.index('myIndex').updateDocuments(documents: Array>>): Promise -``` - -#### [Add or update multiple documents in string format](https://www.meilisearch.com/docs/reference/api/documents#add-or-update-documents) - -```ts -client.index('myIndex').updateDocumentsFromString(documents: string, contentType: ContentType, queryParams: RawDocumentAdditionOptions): Promise -``` - -#### [Add or update multiple documents in batches](https://www.meilisearch.com/docs/reference/api/documents#add-or-update-documents) - -```ts -client.index('myIndex').updateDocumentsInBatches(documents: Array>>, batchSize = 1000): Promise -``` - -#### [Get Documents](https://www.meilisearch.com/docs/reference/api/documents#get-documents) - -```ts -client.index.getDocuments(parameters: DocumentsQuery = {}): Promise>> -``` - -#### [Get one document](https://www.meilisearch.com/docs/reference/api/documents#get-one-document) - -```ts -client.index('myIndex').getDocument(documentId: string): Promise> -``` - -#### [Delete one document](https://www.meilisearch.com/docs/reference/api/documents#delete-one-document) - -```ts -client.index('myIndex').deleteDocument(documentId: string | number): Promise -``` - -#### [Delete multiple documents](https://www.meilisearch.com/docs/reference/api/documents#delete-documents) - -```ts -client.index('myIndex').deleteDocuments(params: DocumentsDeletionQuery | DocumentsIds): Promise -``` - -#### [Delete all documents](https://www.meilisearch.com/docs/reference/api/documents#delete-all-documents) - -```ts -client.index('myIndex').deleteAllDocuments(): Promise -``` - -### Tasks - -#### [Get all tasks](https://www.meilisearch.com/docs/reference/api/tasks#get-all-tasks) - -```ts -client.getTasks(parameters: TasksQuery): Promise -``` - -#### [Get one task](https://www.meilisearch.com/docs/reference/api/tasks) - -```ts -client.getTask(uid: number): Promise -``` - -#### [Delete tasks](https://www.meilisearch.com/docs/reference/api/tasks#delete-tasks) - -```ts -client.deleteTasks(parameters: DeleteTasksQuery = {}): Promise -``` - -#### [Cancel tasks](https://www.meilisearch.com/docs/reference/api/tasks#cancel-tasks) - -```ts -client.cancelTasks(parameters: CancelTasksQuery = {}): Promise -``` - -#### [Get all tasks of an index](https://www.meilisearch.com/docs/reference/api/tasks#get-all-tasks-by-index) - -```ts -client.index('myIndex').getTasks(parameters: TasksQuery): Promise -``` - -#### [Get one task of an index](https://www.meilisearch.com/docs/reference/api/tasks) - -```ts -client.index('myIndex').getTask(uid: number): Promise -``` - - -#### Wait for one task - - -##### Using the client - -```ts -client.waitForTask(uid: number, { timeOutMs?: number, intervalMs?: number }): Promise -``` - -##### Using the index - -```ts -client.index('myIndex').waitForTask(uid: number, { timeOutMs?: number, intervalMs?: number }): Promise -``` - -#### Wait for multiple tasks - -##### Using the client - -```ts -client.waitForTasks(uids: number[], { timeOutMs?: number, intervalMs?: number }): Promise -``` - -##### Using the index - -```ts -client.index('myIndex').waitForTasks(uids: number[], { timeOutMs?: number, intervalMs?: number }): Promise -``` - -### Batches - -#### [Get one batch](https://www.meilisearch.com/docs/reference/api/batches#get-one-batch) - -```ts -client.getBatch(uid: number): Promise -``` - -#### [Get all batches](https://www.meilisearch.com/docs/reference/api/batchess#get-batches) - -```ts -client.getBatches(parameters: BatchesQuery = {}): Promise -``` - -### Indexes - -#### [Get all indexes in Index instances](https://www.meilisearch.com/docs/reference/api/indexes#list-all-indexes) - -```ts -client.getIndexes(parameters: IndexesQuery): Promise> -``` - -#### [Get all indexes](https://www.meilisearch.com/docs/reference/api/indexes#list-all-indexes) - -```ts -client.getRawIndexes(parameters: IndexesQuery): Promise> -``` - - -#### [Create a new index](https://www.meilisearch.com/docs/reference/api/indexes#create-an-index) - -```ts -client.createIndex(uid: string, options?: IndexOptions): Promise -``` - -#### Create a local reference to an index - -```ts -client.index(uid: string): Index -``` - -#### [Get an index instance completed with information fetched from Meilisearch](https://www.meilisearch.com/docs/reference/api/indexes#get-one-index) - -```ts -client.getIndex(uid: string): Promise> -``` - -#### [Get the raw index JSON response from Meilisearch](https://www.meilisearch.com/docs/reference/api/indexes#get-one-index) - -```ts -client.getRawIndex(uid: string): Promise -``` - -#### [Get an object with information about the index](https://www.meilisearch.com/docs/reference/api/indexes#get-one-index) - -```ts -client.index('myIndex').getRawInfo(): Promise -``` - -#### [Update Index](https://www.meilisearch.com/docs/reference/api/indexes#update-an-index) - -##### Using the client - -```ts -client.updateIndex(uid: string, options: IndexOptions): Promise -``` - -##### Using the index object - -```ts -client.index('myIndex').update(data: IndexOptions): Promise -``` - -#### [Delete index](https://www.meilisearch.com/docs/reference/api/indexes#delete-an-index) - -##### Using the client -```ts -client.deleteIndex(uid): Promise -``` - -##### Using the index object -```ts -client.index('myIndex').delete(): Promise -``` - -#### [Get specific index stats](https://www.meilisearch.com/docs/reference/api/stats#get-stats-of-an-index) - -```ts -client.index('myIndex').getStats(): Promise -``` - -##### Return Index instance with updated information - -```ts -client.index('myIndex').fetchInfo(): Promise -``` - -##### Get Primary Key of an Index - -```ts -client.index('myIndex').fetchPrimaryKey(): Promise -``` - -##### Swap two indexes - -```ts -client.swapIndexes(params: SwapIndexesParams): Promise -``` - -### Settings - -#### [Get settings](https://www.meilisearch.com/docs/reference/api/settings#get-settings) - -```ts -client.index('myIndex').getSettings(): Promise -``` - -#### [Update settings](https://www.meilisearch.com/docs/reference/api/settings#update-settings) - -```ts -client.index('myIndex').updateSettings(settings: Settings): Promise -``` - -#### [Reset settings](https://www.meilisearch.com/docs/reference/api/settings#reset-settings) - -```ts -client.index('myIndex').resetSettings(): Promise -``` - -### Pagination Settings - -#### [Get pagination](https://www.meilisearch.com/docs/reference/api/settings#get-pagination-settings) - -```ts -client.index('myIndex').getPagination(): Promise -``` - -#### [Update pagination](https://www.meilisearch.com/docs/reference/api/settings#update-pagination-settings) - -```ts -client.index('myIndex').updatePagination(pagination: PaginationSettings): Promise -``` - -#### [Reset pagination](https://www.meilisearch.com/docs/reference/api/settings#reset-pagination-settings) - -```ts -client.index('myIndex').resetPagination(): Promise -``` - -### Synonyms - -#### [Get synonyms](https://www.meilisearch.com/docs/reference/api/settings#get-synonyms) - -```ts -client.index('myIndex').getSynonyms(): Promise -``` - -#### [Update synonyms](https://www.meilisearch.com/docs/reference/api/settings#update-synonyms) - -```ts -client.index('myIndex').updateSynonyms(synonyms: Synonyms): Promise -``` - -#### [Reset synonyms](https://www.meilisearch.com/docs/reference/api/settings#reset-synonyms) - -```ts -client.index('myIndex').resetSynonyms(): Promise -``` - -### Stop words - -#### [Get stop words](https://www.meilisearch.com/docs/reference/api/settings#get-stop-words) - -```ts -client.index('myIndex').getStopWords(): Promise -``` - -#### [Update stop words](https://www.meilisearch.com/docs/reference/api/settings#update-stop-words) - -```ts -client.index('myIndex').updateStopWords(stopWords: string[] | null ): Promise -``` - -#### [Reset stop words](https://www.meilisearch.com/docs/reference/api/settings#reset-stop-words) - -```ts -client.index('myIndex').resetStopWords(): Promise -``` - -### Ranking rules - -#### [Get ranking rules](https://www.meilisearch.com/docs/reference/api/settings#get-ranking-rules) - -```ts -client.index('myIndex').getRankingRules(): Promise -``` - -#### [Update ranking rules](https://www.meilisearch.com/docs/reference/api/settings#update-ranking-rules) - -```ts -client.index('myIndex').updateRankingRules(rankingRules: string[] | null): Promise -``` - -#### [Reset ranking rules](https://www.meilisearch.com/docs/reference/api/settings#reset-ranking-rules) - -```ts -client.index('myIndex').resetRankingRules(): Promise -``` - -### Distinct Attribute - -#### [Get distinct attribute](https://www.meilisearch.com/docs/reference/api/settings#get-distinct-attribute) - -```ts -client.index('myIndex').getDistinctAttribute(): Promise -``` - -#### [Update distinct attribute](https://www.meilisearch.com/docs/reference/api/settings#update-distinct-attribute) - -```ts -client.index('myIndex').updateDistinctAttribute(distinctAttribute: string | null): Promise -``` - -#### [Reset distinct attribute](https://www.meilisearch.com/docs/reference/api/settings#reset-distinct-attribute) - -```ts -client.index('myIndex').resetDistinctAttribute(): Promise -``` - -### Searchable attributes - -#### [Get searchable attributes](https://www.meilisearch.com/docs/reference/api/settings#get-searchable-attributes) - -```ts -client.index('myIndex').getSearchableAttributes(): Promise -``` - -#### [Update searchable attributes](https://www.meilisearch.com/docs/reference/api/settings#update-searchable-attributes) - -```ts -client.index('myIndex').updateSearchableAttributes(searchableAttributes: string[] | null): Promise -``` - -#### [Reset searchable attributes](https://www.meilisearch.com/docs/reference/api/settings#reset-searchable-attributes) - -```ts -client.index('myIndex').resetSearchableAttributes(): Promise -``` - -### Displayed attributes - -#### [Get displayed attributes](https://www.meilisearch.com/docs/reference/api/settings#get-displayed-attributes) - -```ts -client.index('myIndex').getDisplayedAttributes(): Promise -``` - -#### [Update displayed attributes](https://www.meilisearch.com/docs/reference/api/settings#update-displayed-attributes) - -```ts -client.index('myIndex').updateDisplayedAttributes(displayedAttributes: string[] | null): Promise -``` - -#### [Reset displayed attributes](https://www.meilisearch.com/docs/reference/api/settings#reset-displayed-attributes) - -```ts -client.index('myIndex').resetDisplayedAttributes(): Promise -``` - -### Filterable attributes - -#### [Get filterable attributes](https://www.meilisearch.com/docs/reference/api/settings#get-filterable-attributes) - -```ts -client.index('myIndex').getFilterableAttributes(): Promise -``` - -#### [Update filterable attributes](https://www.meilisearch.com/docs/reference/api/settings#update-filterable-attributes) - -```ts -client.index('myIndex').updateFilterableAttributes(filterableAttributes: string[] | null): Promise -``` - -#### [Reset filterable attributes](https://www.meilisearch.com/docs/reference/api/settings#reset-filterable-attributes) - -```ts -client.index('myIndex').resetFilterableAttributes(): Promise -``` - -### Sortable attributes - -#### [Get sortable attributes](https://www.meilisearch.com/docs/reference/api/settings#get-sortable-attributes) - -```ts -client.index('myIndex').getSortableAttributes(): Promise -``` - -#### [Update sortable attributes](https://www.meilisearch.com/docs/reference/api/settings#update-sortable-attributes) - -```ts -client.index('myIndex').updateSortableAttributes(sortableAttributes: string[] | null): Promise -``` - -#### [Reset sortable attributes](https://www.meilisearch.com/docs/reference/api/settings#reset-sortable-attributes) - -```ts -client.index('myIndex').resetSortableAttributes(): Promise -``` - -### Faceting - -#### [Get faceting](https://www.meilisearch.com/docs/reference/api/settings#get-faceting-settings) - -```ts -client.index('myIndex').getFaceting(): Promise -``` - -#### [Update faceting](https://www.meilisearch.com/docs/reference/api/settings#update-faceting-settings) - -```ts -client.index('myIndex').updateFaceting(faceting: Faceting): Promise -``` - -#### [Reset faceting](https://www.meilisearch.com/docs/reference/api/settings#reset-faceting-settings) - -```ts -client.index('myIndex').resetFaceting(): Promise -``` - -### Typo tolerance - -#### [Get typo tolerance](https://www.meilisearch.com/docs/reference/api/settings#get-typo-tolerance-settings) - -```ts -client.index('myIndex').getTypoTolerance(): Promise -``` - -#### [Update typo tolerance](https://www.meilisearch.com/docs/reference/api/settings#update-typo-tolerance-settings) - -```ts -client.index('myIndex').updateTypoTolerance(typoTolerance: TypoTolerance | null): Promise -``` - -#### [Reset typo tolerance](https://www.meilisearch.com/docs/reference/api/settings#reset-typo-tolerance-settings) - -```ts -client.index('myIndex').resetTypoTolerance(): Promise -``` - - -### Separator tokens - -#### [Get separator tokens](https://www.meilisearch.com/docs/reference/api/settings#get-separator-tokens) - -```ts -client.index('myIndex').getSeparatorTokens(): Promise -``` - -#### [Update separator tokens](https://www.meilisearch.com/docs/reference/api/settings#update-separator-tokens) - -```ts -client.index('myIndex').updateSeparatorTokens(separatorTokens: SeparatorTokens | null): Promise -``` - -#### [Reset separator tokens](https://www.meilisearch.com/docs/reference/api/settings#reset-separator-tokens) - -```ts -client.index('myIndex').resetSeparatorTokens(): Promise -``` - -### Non Separator tokens - -#### [Get non separator tokens](https://www.meilisearch.com/docs/reference/api/settings#get-non-separator-tokens) - -```ts -client.index('myIndex').getNonSeparatorTokens(): Promise -``` - -#### [Update non separator tokens](https://www.meilisearch.com/docs/reference/api/settings#update-non-separator-tokens) - -```ts -client.index('myIndex').updateNonSeparatorTokens(nonSeparatorTokens: NonSeparatorTokens | null): Promise -``` - -#### [Reset non separator tokens](https://www.meilisearch.com/docs/reference/api/settings#reset-non-separator-tokens) - -```ts -client.index('myIndex').resetNonSeparatorTokens(): Promise -``` - -### Dictionary - -#### [Get dictionary](https://www.meilisearch.com/docs/reference/api/settings#get-dictionary) - -```ts -client.index('myIndex').getDictionary(): Promise -``` - -#### [Update dictionary](https://www.meilisearch.com/docs/reference/api/settings#update-dictionary) - -```ts -client.index('myIndex').updateDictionary(dictionary: Dictionary | null): Promise -``` - -#### [Reset dictionary](https://www.meilisearch.com/docs/reference/api/settings#reset-dictionary) - -```ts -client.index('myIndex').resetDictionary(): Promise -``` - -### Proximity Precision - -#### [Get proximity precision](https://www.meilisearch.com/docs/reference/api/settings#get-proximity-precision-settings) - -```ts -client.index('myIndex').getProximityPrecision(): Promise -``` - -#### [Update proximity precision](https://www.meilisearch.com/docs/reference/api/settings#update-proximity-precision-settings) - -```ts -client.index('myIndex').updateProximityPrecision(proximityPrecision: ProximityPrecision): Promise -``` - -#### [Reset proximity precision](https://www.meilisearch.com/docs/reference/api/settings#reset-proximity-precision-settings) - -```ts -client.index('myIndex').resetProximityPrecision(): Promise -``` - -### Facet search settings - -#### [Get facet search settings](https://www.meilisearch.com/docs/reference/api/settings#get-facet-search-settings) - -```ts -client.index('myIndex').getFacetSearch(): Promise -``` - -#### [Update facet search settings](https://www.meilisearch.com/docs/reference/api/settings#update-facet-search-settings) - -```ts -client.index('myIndex').updateFacetSearch(enabled: boolean): Promise -``` - -#### [Reset facet search settings](https://www.meilisearch.com/docs/reference/api/settings#reset-facet-search-settings) - -```ts -client.index('myIndex').resetFacetSearch(): Promise -``` - -### Prefix search settings - -#### [Get prefix search settings](https://www.meilisearch.com/docs/reference/api/settings#get-prefix-search-settings) - -```ts -client.index('myIndex').getPrefixSearch(): Promise -``` - -#### [Update prefix search settings](https://www.meilisearch.com/docs/reference/api/settings#update-prefix-search-settings) - -```ts -client.index('myIndex').updatePrefixSearch(prefixSearch: PrefixSearch): Promise -``` - -#### [Reset prefix search settings](https://www.meilisearch.com/docs/reference/api/settings#reset-prefix-search-settings) - -```ts -client.index('myIndex').resetPrefixSearch(): Promise -``` - -### Embedders - -⚠️ This feature is experimental. Activate the [`vectorStore` experimental feature to use it](https://www.meilisearch.com/docs/reference/api/experimental_features#configure-experimental-features) - -#### Get embedders - -```ts -client.index('myIndex').getEmbedders(): Promise -``` - -#### Update embedders - -```ts -client.index('myIndex').updateEmbedders(embedders: Embedders): Promise -``` - -#### Reset embedders - -```ts -client.index('myIndex').resetEmbedders(): Promise -``` - -### SearchCutoffMs - -#### [Get SearchCutoffMs](https://www.meilisearch.com/docs/reference/api/settings#get-search-cutoff) - -```ts -client.index('myIndex').getSearchCutoffMs(): Promise -``` - -#### [Update SearchCutoffMs](https://www.meilisearch.com/docs/reference/api/settings#update-search-cutoff) - -```ts -client.index('myIndex').updateSearchCutoffMs(searchCutoffMs: SearchCutoffMs): Promise -``` - -#### [Reset SearchCutoffMs](https://www.meilisearch.com/docs/reference/api/settings#reset-search-cutoff) - -```ts -client.index('myIndex').resetSearchCutoffMs(): Promise -``` - -### Keys - -#### [Get keys](https://www.meilisearch.com/docs/reference/api/keys#get-all-keys) - -```ts -client.getKeys(parameters: KeysQuery): Promise -``` - -#### [Get one key](https://www.meilisearch.com/docs/reference/api/keys#get-one-key) - -```ts -client.getKey(keyOrUid: string): Promise -``` - -#### [Create a key](https://www.meilisearch.com/docs/reference/api/keys#create-a-key) - -```ts -client.createKey(options: KeyCreation): Promise -``` - -#### [Update a key](https://www.meilisearch.com/docs/reference/api/keys#update-a-key) - -```ts -client.updateKey(keyOrUid: string, options: KeyUpdate): Promise -``` - -#### [Delete a key](https://www.meilisearch.com/docs/reference/api/keys#delete-a-key) - -```ts -client.deleteKey(keyOrUid: string): Promise -``` - -### `isHealthy` - -#### [Return `true` or `false` depending on the health of the server](https://www.meilisearch.com/docs/reference/api/health#get-health) - -```ts -client.isHealthy(): Promise -``` - -### Health - -#### [Check if the server is healthy](https://www.meilisearch.com/docs/reference/api/health#get-health) - -```ts -client.health(): Promise -``` - -### Stats - -#### [Get database stats](https://www.meilisearch.com/docs/reference/api/stats#get-stats-of-all-indexes) - -```ts -client.getStats(): Promise -``` - -### Version - -#### [Get binary version](https://www.meilisearch.com/docs/reference/api/version#get-version-of-meilisearch) - -```ts -client.getVersion(): Promise -``` - -### Dumps - -#### [Trigger a dump creation process](https://www.meilisearch.com/docs/reference/api/dump#create-a-dump) - -```ts -client.createDump(): Promise -``` - -### Snapshots - -#### [Trigger a snapshot on-demand process](https://www.meilisearch.com/docs/reference/api/snapshots#create-a-snapshot) - -```ts -client.createSnapshot(): Promise -``` --- Meilisearch provides and maintains many SDKs and integration tools like this one. We want to provide everyone with an **amazing search experience for any kind of project**. For a full overview of everything we create and maintain, take a look at the [integration-guides](https://github.com/meilisearch/integration-guides) repository. From 44d4758f4b1837e9732901d3c0f282fe69691e63 Mon Sep 17 00:00:00 2001 From: "F. Levi" <55688616+flevi29@users.noreply.github.com> Date: Wed, 22 Jan 2025 15:45:17 +0200 Subject: [PATCH 02/10] Refactor playgrounds, README --- README.md | 4 +- package.json | 5 +- playgrounds/javascript/.gitignore | 24 -- playgrounds/javascript/README.md | 17 - playgrounds/javascript/index.html | 20 +- playgrounds/javascript/package.json | 14 - playgrounds/javascript/src/app.css | 51 --- playgrounds/javascript/src/app.js | 60 ---- playgrounds/javascript/src/main.ts | 30 ++ playgrounds/javascript/src/meilisearch.ts | 49 +++ .../javascript/src/{index.css => style.css} | 6 - playgrounds/javascript/src/vite-env.d.ts | 1 + playgrounds/javascript/yarn.lock | 327 ------------------ tsconfig.json | 3 +- vite.config.js => vite.config.ts | 0 15 files changed, 91 insertions(+), 520 deletions(-) delete mode 100644 playgrounds/javascript/.gitignore delete mode 100644 playgrounds/javascript/README.md delete mode 100644 playgrounds/javascript/package.json delete mode 100644 playgrounds/javascript/src/app.css delete mode 100644 playgrounds/javascript/src/app.js create mode 100644 playgrounds/javascript/src/main.ts create mode 100644 playgrounds/javascript/src/meilisearch.ts rename playgrounds/javascript/src/{index.css => style.css} (80%) create mode 100644 playgrounds/javascript/src/vite-env.d.ts delete mode 100644 playgrounds/javascript/yarn.lock rename vite.config.js => vite.config.ts (100%) diff --git a/README.md b/README.md index 3047c589f..c16884cc9 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Node.js [LTS and Maintenance versions](https://github.com/nodejs/Release?tab=rea Other runtimes, like Deno and Bun aren't tested, but if they do not work with this package, pelase open an issue. -### Run Meilisearch +### Run Meilisearch ⚡️ **Launch, scale, and streamline in minutes with Meilisearch Cloud**—no maintenance, no commitment, cancel anytime. [Try it free now](https://cloud.meilisearch.com/login?utm_campaign=oss&utm_source=github&utm_medium=meilisearch-js). @@ -58,7 +58,7 @@ Other runtimes, like Deno and Bun aren't tested, but if they do not work with th ## 🚀 Example code - +Take a look at the [playground](./playgrounds/javascript/src/meilisearch.ts) to see example code. ## 🤖 Compatibility with Meilisearch diff --git a/package.json b/package.json index ec696297a..821da058f 100644 --- a/package.json +++ b/package.json @@ -39,12 +39,12 @@ "url": "https://github.com/meilisearch/meilisearch-js" }, "scripts": { - "playground:javascript": "yarn --cwd ./playgrounds/javascript && yarn --cwd ./playgrounds/javascript dev", + "playground:javascript": "vite serve playgrounds/javascript --open", "build:docs": "typedoc", "build": "vite build && tsc -p tsconfig.build.json && vite --mode production-umd build", "postbuild": "node scripts/build.js", "test": "vitest run --coverage", - "types": "tsc -p tsconfig.json --noEmit", + "types": "tsc --noEmit", "types:watch": "yarn types --watch", "test:env:browser": "yarn build && node scripts/copy-umd-file.js --to ./tests/env/express/public && yarn --cwd tests/env/express && yarn --cwd tests/env/express test", "test:watch": "vitest watch", @@ -55,6 +55,7 @@ "test:env:nodejs": "yarn build && node tests/env/node/index.cjs && node tests/env/node/getting_started.cjs", "test:env:esm": "yarn --cwd tests/env/esm && yarn --cwd tests/env/esm start", "test:env:nitro-app": "yarn build && yarn --cwd tests/env/nitro-app test", + "todo": "open issue about formatting everything that can be formatted with prettier", "fmt": "prettier -c ./**/*.{js,ts}", "fmt:fix": "prettier -w ./**/*.{js,ts}", "lint": "eslint", diff --git a/playgrounds/javascript/.gitignore b/playgrounds/javascript/.gitignore deleted file mode 100644 index a547bf36d..000000000 --- a/playgrounds/javascript/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* - -node_modules -dist -dist-ssr -*.local - -# Editor directories and files -.vscode/* -!.vscode/extensions.json -.idea -.DS_Store -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? diff --git a/playgrounds/javascript/README.md b/playgrounds/javascript/README.md deleted file mode 100644 index 0feaec030..000000000 --- a/playgrounds/javascript/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Meilisearch JavaScript playground - -This is an example vanilla JavaScript project using [Vite](https://vite.dev) and the [Yarn](https://classic.yarnpkg.com/en/docs/install) package manager. - -## Development - -Install the dependencies: - -```bash -yarn -``` - -Run the app in development: - -```bash -yarn dev -``` diff --git a/playgrounds/javascript/index.html b/playgrounds/javascript/index.html index 268c0806e..edc95cb4a 100644 --- a/playgrounds/javascript/index.html +++ b/playgrounds/javascript/index.html @@ -1,24 +1,12 @@ - - - + + Meilisearch + Vite -

Meilisearch + Vite

-

Errors:

-
- -

Movies index:

-
-

Search response:

-
- - +
+ diff --git a/playgrounds/javascript/package.json b/playgrounds/javascript/package.json deleted file mode 100644 index c82bf098a..000000000 --- a/playgrounds/javascript/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "meilisearch-js-playground", - "version": "0.2.0", - "description": "Meilisearch playground written with Vite", - "type": "module", - "scripts": { - "dev": "vite", - "build": "vite build", - "preview": "vite preview" - }, - "devDependencies": { - "vite": "^6.0.5" - } -} diff --git a/playgrounds/javascript/src/app.css b/playgrounds/javascript/src/app.css deleted file mode 100644 index 544a84abc..000000000 --- a/playgrounds/javascript/src/app.css +++ /dev/null @@ -1,51 +0,0 @@ -body { - font-family: sans-serif; - padding: 1em; -} - -.ais-ClearRefinements { - margin: 1em 0; -} - -.ais-SearchBox { - margin: 1em 0; -} - -.ais-Pagination { - margin-top: 1em; -} - -.left-panel { - float: left; - width: 200px; -} - -.right-panel { - margin-left: 210px; -} - -.ais-InstantSearch { - max-width: 960px; - overflow: hidden; - margin: 0 auto; -} - -.ais-Hits-item { - margin-bottom: 1em; - width: calc(50% - 1rem); -} - -.ais-Hits-item img { - margin-right: 1em; - width: 100%; - height: 100%; - margin-bottom: 0.5em; -} - -.hit-name { - margin-bottom: 0.5em; -} - -.hit-info { - font-size: 90%; -} diff --git a/playgrounds/javascript/src/app.js b/playgrounds/javascript/src/app.js deleted file mode 100644 index d0fc2a205..000000000 --- a/playgrounds/javascript/src/app.js +++ /dev/null @@ -1,60 +0,0 @@ -import { Meilisearch } from "../../../src"; - -const config = { - host: "http://127.0.0.1:7700", - apiKey: "masterKey", -}; - -const client = new Meilisearch(config); -const indexUid = "movies"; - -const addDataset = async () => { - await client.deleteIndex(indexUid); - const { taskUid } = await client.createIndex(indexUid); - await client.index(indexUid).waitForTask(taskUid); - - const documents = await client.index(indexUid).getDocuments(); - - const dataset = [ - { id: 1, title: "Carol", genres: ["Romance", "Drama"] }, - { id: 2, title: "Wonder Woman", genres: ["Action", "Adventure"] }, - { id: 3, title: "Life of Pi", genres: ["Adventure", "Drama"] }, - { - id: 4, - title: "Mad Max: Fury Road", - genres: ["Adventure", "Science Fiction"], - }, - { id: 5, title: "Moana", genres: ["Fantasy", "Action"] }, - { id: 6, title: "Philadelphia", genres: ["Drama"] }, - ]; - if (documents.results.length === 0) { - const { taskUid } = await client.index(indexUid).addDocuments(dataset); - await client.index(indexUid).waitForTask(taskUid); - } -}; - -(async () => { - try { - await addDataset(); - const indexes = await client.getRawIndexes(); - document.querySelector(".indexes").innerText = JSON.stringify( - indexes, - null, - 1, - ); - const resp = await client.index(indexUid).search("", { - attributesToHighlight: ["title"], - }); - console.log({ resp }); - console.log({ hit: resp.hits[0] }); - document.querySelector(".hits").innerText = JSON.stringify( - resp.hits.map((hit) => hit.title), - null, - 1, - ); - document.querySelector(".errors_title").style.display = "none"; - } catch (e) { - console.error(e); - document.querySelector(".errors").innerText = JSON.stringify(e, null, 1); - } -})(); diff --git a/playgrounds/javascript/src/main.ts b/playgrounds/javascript/src/main.ts new file mode 100644 index 000000000..da5ed4c57 --- /dev/null +++ b/playgrounds/javascript/src/main.ts @@ -0,0 +1,30 @@ +import "./style.css"; +import { addDocuments, getAllHits, getSearchResponse } from "./meilisearch.js"; + +document.querySelector("#app")!.innerHTML = ` +
+

Meilisearch + Vite

+ +

Documents:

+
-
+ +

Search response:

+
-
+ +

Errors:

+
None
+
+`; + +try { + await addDocuments(); + await getAllHits(document.querySelector("#hits")!); + await getSearchResponse(document.querySelector("#response")!); +} catch (error) { + console.error(error); + document.querySelector("#errors")!.innerText = JSON.stringify( + error, + null, + 4, + ); +} diff --git a/playgrounds/javascript/src/meilisearch.ts b/playgrounds/javascript/src/meilisearch.ts new file mode 100644 index 000000000..2dba394bb --- /dev/null +++ b/playgrounds/javascript/src/meilisearch.ts @@ -0,0 +1,49 @@ +import { Index, Meilisearch } from "../../../src/index.js"; + +const client = new Meilisearch({ + host: "http://127.0.0.1:7700", + apiKey: "masterKey", +}); +const indexUid = "movies"; +const index = client.index<{ id: number; title: string; genres: string[] }>( + indexUid, +); + +export async function addDocuments(): Promise { + await client.deleteIndexIfExists(indexUid); + + const task1 = await client.createIndex(indexUid); + await client.waitForTask(task1.taskUid); + + const task2 = await index.addDocuments([ + { id: 1, title: "Carol", genres: ["Romance", "Drama"] }, + { id: 2, title: "Wonder Woman", genres: ["Action", "Adventure"] }, + { id: 3, title: "Life of Pi", genres: ["Adventure", "Drama"] }, + { + id: 4, + title: "Mad Max: Fury Road", + genres: ["Adventure", "Science Fiction"], + }, + { id: 5, title: "Moana", genres: ["Fantasy", "Action"] }, + { id: 6, title: "Philadelphia", genres: ["Drama"] }, + ]); + + await client.index(indexUid).waitForTask(task2.taskUid); +} + +export async function getAllHits(element: HTMLDivElement): Promise { + const documents = await index.getDocuments(); + + element.innerText = JSON.stringify(documents, null, 4); +} + +export async function getSearchResponse(element: HTMLDivElement) { + const params: Parameters = [ + "philoudelphia", + { attributesToHighlight: ["title"] }, + ]; + + const response = await client.index(indexUid).search(...params); + + element.innerText = `PARAMETERS: ${JSON.stringify(params, null, 4)}\nRESPONSE: ${JSON.stringify(response, null, 4)}`; +} diff --git a/playgrounds/javascript/src/index.css b/playgrounds/javascript/src/style.css similarity index 80% rename from playgrounds/javascript/src/index.css rename to playgrounds/javascript/src/style.css index 30475b7b8..ddf6145e9 100644 --- a/playgrounds/javascript/src/index.css +++ b/playgrounds/javascript/src/style.css @@ -1,9 +1,3 @@ -body, -h1 { - margin: 0; - padding: 0; -} - body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; diff --git a/playgrounds/javascript/src/vite-env.d.ts b/playgrounds/javascript/src/vite-env.d.ts new file mode 100644 index 000000000..11f02fe2a --- /dev/null +++ b/playgrounds/javascript/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/playgrounds/javascript/yarn.lock b/playgrounds/javascript/yarn.lock deleted file mode 100644 index 7993e79f7..000000000 --- a/playgrounds/javascript/yarn.lock +++ /dev/null @@ -1,327 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@esbuild/aix-ppc64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.24.2.tgz#38848d3e25afe842a7943643cbcd387cc6e13461" - integrity sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA== - -"@esbuild/android-arm64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.24.2.tgz#f592957ae8b5643129fa889c79e69cd8669bb894" - integrity sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg== - -"@esbuild/android-arm@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.24.2.tgz#72d8a2063aa630308af486a7e5cbcd1e134335b3" - integrity sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q== - -"@esbuild/android-x64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.24.2.tgz#9a7713504d5f04792f33be9c197a882b2d88febb" - integrity sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw== - -"@esbuild/darwin-arm64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.24.2.tgz#02ae04ad8ebffd6e2ea096181b3366816b2b5936" - integrity sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA== - -"@esbuild/darwin-x64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.24.2.tgz#9ec312bc29c60e1b6cecadc82bd504d8adaa19e9" - integrity sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA== - -"@esbuild/freebsd-arm64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.2.tgz#5e82f44cb4906d6aebf24497d6a068cfc152fa00" - integrity sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg== - -"@esbuild/freebsd-x64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.24.2.tgz#3fb1ce92f276168b75074b4e51aa0d8141ecce7f" - integrity sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q== - -"@esbuild/linux-arm64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.24.2.tgz#856b632d79eb80aec0864381efd29de8fd0b1f43" - integrity sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg== - -"@esbuild/linux-arm@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.24.2.tgz#c846b4694dc5a75d1444f52257ccc5659021b736" - integrity sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA== - -"@esbuild/linux-ia32@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.24.2.tgz#f8a16615a78826ccbb6566fab9a9606cfd4a37d5" - integrity sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw== - -"@esbuild/linux-loong64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.24.2.tgz#1c451538c765bf14913512c76ed8a351e18b09fc" - integrity sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ== - -"@esbuild/linux-mips64el@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.24.2.tgz#0846edeefbc3d8d50645c51869cc64401d9239cb" - integrity sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw== - -"@esbuild/linux-ppc64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.24.2.tgz#8e3fc54505671d193337a36dfd4c1a23b8a41412" - integrity sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw== - -"@esbuild/linux-riscv64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.24.2.tgz#6a1e92096d5e68f7bb10a0d64bb5b6d1daf9a694" - integrity sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q== - -"@esbuild/linux-s390x@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.24.2.tgz#ab18e56e66f7a3c49cb97d337cd0a6fea28a8577" - integrity sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw== - -"@esbuild/linux-x64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.24.2.tgz#8140c9b40da634d380b0b29c837a0b4267aff38f" - integrity sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q== - -"@esbuild/netbsd-arm64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.24.2.tgz#65f19161432bafb3981f5f20a7ff45abb2e708e6" - integrity sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw== - -"@esbuild/netbsd-x64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.24.2.tgz#7a3a97d77abfd11765a72f1c6f9b18f5396bcc40" - integrity sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw== - -"@esbuild/openbsd-arm64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.2.tgz#58b00238dd8f123bfff68d3acc53a6ee369af89f" - integrity sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A== - -"@esbuild/openbsd-x64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.24.2.tgz#0ac843fda0feb85a93e288842936c21a00a8a205" - integrity sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA== - -"@esbuild/sunos-x64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.24.2.tgz#8b7aa895e07828d36c422a4404cc2ecf27fb15c6" - integrity sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig== - -"@esbuild/win32-arm64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.24.2.tgz#c023afb647cabf0c3ed13f0eddfc4f1d61c66a85" - integrity sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ== - -"@esbuild/win32-ia32@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.24.2.tgz#96c356132d2dda990098c8b8b951209c3cd743c2" - integrity sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA== - -"@esbuild/win32-x64@0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.24.2.tgz#34aa0b52d0fbb1a654b596acfa595f0c7b77a77b" - integrity sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg== - -"@rollup/rollup-android-arm-eabi@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.29.2.tgz#d4c3965f18ebf567a99154f93bcf283fd527e2a9" - integrity sha512-s/8RiF4bdmGnc/J0N7lHAr5ZFJj+NdJqJ/Hj29K+c4lEdoVlukzvWXB9XpWZCdakVT0YAw8iyIqUP2iFRz5/jA== - -"@rollup/rollup-android-arm64@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.29.2.tgz#cbc7e636a7aab984161fc045039bf3c6abb50083" - integrity sha512-mKRlVj1KsKWyEOwR6nwpmzakq6SgZXW4NUHNWlYSiyncJpuXk7wdLzuKdWsRoR1WLbWsZBKvsUCdCTIAqRn9cA== - -"@rollup/rollup-darwin-arm64@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.29.2.tgz#d084c6120f96749a7ddc5ef81d8740f2525abb6e" - integrity sha512-vJX+vennGwygmutk7N333lvQ/yKVAHnGoBS2xMRQgXWW8tvn46YWuTDOpKroSPR9BEW0Gqdga2DHqz8Pwk6X5w== - -"@rollup/rollup-darwin-x64@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.29.2.tgz#1393f12d5722cc39b8c014aedd4b4da8043929a9" - integrity sha512-e2rW9ng5O6+Mt3ht8fH0ljfjgSCC6ffmOipiLUgAnlK86CHIaiCdHCzHzmTkMj6vEkqAiRJ7ss6Ibn56B+RE5w== - -"@rollup/rollup-freebsd-arm64@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.29.2.tgz#1c11650970c4b52d7fb077f5a4a6e16ba5e6db4f" - integrity sha512-/xdNwZe+KesG6XJCK043EjEDZTacCtL4yurMZRLESIgHQdvtNyul3iz2Ab03ZJG0pQKbFTu681i+4ETMF9uE/Q== - -"@rollup/rollup-freebsd-x64@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.29.2.tgz#d3d79a2b96e81475571cb9bb414910450bcebe04" - integrity sha512-eXKvpThGzREuAbc6qxnArHh8l8W4AyTcL8IfEnmx+bcnmaSGgjyAHbzZvHZI2csJ+e0MYddl7DX0X7g3sAuXDQ== - -"@rollup/rollup-linux-arm-gnueabihf@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.29.2.tgz#14a39257111abbc38412805c9162819d3bb248c1" - integrity sha512-h4VgxxmzmtXLLYNDaUcQevCmPYX6zSj4SwKuzY7SR5YlnCBYsmvfYORXgiU8axhkFCDtQF3RW5LIXT8B14Qykg== - -"@rollup/rollup-linux-arm-musleabihf@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.29.2.tgz#64304812643515c0ed83cdaf4fde034c35dbc776" - integrity sha512-EObwZ45eMmWZQ1w4N7qy4+G1lKHm6mcOwDa+P2+61qxWu1PtQJ/lz2CNJ7W3CkfgN0FQ7cBUy2tk6D5yR4KeXw== - -"@rollup/rollup-linux-arm64-gnu@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.29.2.tgz#60d457954c288c168049aadb304c204d8a680236" - integrity sha512-Z7zXVHEXg1elbbYiP/29pPwlJtLeXzjrj4241/kCcECds8Zg9fDfURWbZHRIKrEriAPS8wnVtdl4ZJBvZr325w== - -"@rollup/rollup-linux-arm64-musl@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.29.2.tgz#17deb5058243bc5599164a9e0a899b0902310fca" - integrity sha512-TF4kxkPq+SudS/r4zGPf0G08Bl7+NZcFrUSR3484WwsHgGgJyPQRLCNrQ/R5J6VzxfEeQR9XRpc8m2t7lD6SEQ== - -"@rollup/rollup-linux-loongarch64-gnu@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.29.2.tgz#5c65dd6557fda1f45c285cfeb4c5eda4c868341d" - integrity sha512-kO9Fv5zZuyj2zB2af4KA29QF6t7YSxKrY7sxZXfw8koDQj9bx5Tk5RjH+kWKFKok0wLGTi4bG117h31N+TIBEg== - -"@rollup/rollup-linux-powerpc64le-gnu@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.29.2.tgz#33e45cac222fa6d09891f73bfb2d5d027ec34989" - integrity sha512-gIh776X7UCBaetVJGdjXPFurGsdWwHHinwRnC5JlLADU8Yk0EdS/Y+dMO264OjJFo7MXQ5PX4xVFbxrwK8zLqA== - -"@rollup/rollup-linux-riscv64-gnu@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.29.2.tgz#1edee7a06538597720c4bf8178367d4b5651717d" - integrity sha512-YgikssQ5UNq1GoFKZydMEkhKbjlUq7G3h8j6yWXLBF24KyoA5BcMtaOUAXq5sydPmOPEqB6kCyJpyifSpCfQ0w== - -"@rollup/rollup-linux-s390x-gnu@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.29.2.tgz#0ad4aaae2fd89c3607b743c63514c4561905672b" - integrity sha512-9ouIR2vFWCyL0Z50dfnon5nOrpDdkTG9lNDs7MRaienQKlTyHcDxplmk3IbhFlutpifBSBr2H4rVILwmMLcaMA== - -"@rollup/rollup-linux-x64-gnu@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.29.2.tgz#ae27f8d26c02d8ce6f84275860e99678b9f3e932" - integrity sha512-ckBBNRN/F+NoSUDENDIJ2U9UWmIODgwDB/vEXCPOMcsco1niTkxTXa6D2Y/pvCnpzaidvY2qVxGzLilNs9BSzw== - -"@rollup/rollup-linux-x64-musl@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.29.2.tgz#24ff1a64dddd75c489bd8714bcb5a659769d3e4a" - integrity sha512-jycl1wL4AgM2aBFJFlpll/kGvAjhK8GSbEmFT5v3KC3rP/b5xZ1KQmv0vQQ8Bzb2ieFQ0kZFPRMbre/l3Bu9JA== - -"@rollup/rollup-win32-arm64-msvc@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.29.2.tgz#7c56efd576618db251909e21818d473cbcf96786" - integrity sha512-S2V0LlcOiYkNGlRAWZwwUdNgdZBfvsDHW0wYosYFV3c7aKgEVcbonetZXsHv7jRTTX+oY5nDYT4W6B1oUpMNOg== - -"@rollup/rollup-win32-ia32-msvc@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.29.2.tgz#0b77e11129b04bb5b9bfff4b011d084a975190e0" - integrity sha512-pW8kioj9H5f/UujdoX2atFlXNQ9aCfAxFRaa+mhczwcsusm6gGrSo4z0SLvqLF5LwFqFTjiLCCzGkNK/LE0utQ== - -"@rollup/rollup-win32-x64-msvc@4.29.2": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.29.2.tgz#dc89d92418ae2efa1d70e071c686cffbcf788147" - integrity sha512-p6fTArexECPf6KnOHvJXRpAEq0ON1CBtzG/EY4zw08kCHk/kivBc5vUEtnCFNCHOpJZ2ne77fxwRLIKD4wuW2Q== - -"@types/estree@1.0.6": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" - integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== - -esbuild@^0.24.2: - version "0.24.2" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.24.2.tgz#b5b55bee7de017bff5fb8a4e3e44f2ebe2c3567d" - integrity sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA== - optionalDependencies: - "@esbuild/aix-ppc64" "0.24.2" - "@esbuild/android-arm" "0.24.2" - "@esbuild/android-arm64" "0.24.2" - "@esbuild/android-x64" "0.24.2" - "@esbuild/darwin-arm64" "0.24.2" - "@esbuild/darwin-x64" "0.24.2" - "@esbuild/freebsd-arm64" "0.24.2" - "@esbuild/freebsd-x64" "0.24.2" - "@esbuild/linux-arm" "0.24.2" - "@esbuild/linux-arm64" "0.24.2" - "@esbuild/linux-ia32" "0.24.2" - "@esbuild/linux-loong64" "0.24.2" - "@esbuild/linux-mips64el" "0.24.2" - "@esbuild/linux-ppc64" "0.24.2" - "@esbuild/linux-riscv64" "0.24.2" - "@esbuild/linux-s390x" "0.24.2" - "@esbuild/linux-x64" "0.24.2" - "@esbuild/netbsd-arm64" "0.24.2" - "@esbuild/netbsd-x64" "0.24.2" - "@esbuild/openbsd-arm64" "0.24.2" - "@esbuild/openbsd-x64" "0.24.2" - "@esbuild/sunos-x64" "0.24.2" - "@esbuild/win32-arm64" "0.24.2" - "@esbuild/win32-ia32" "0.24.2" - "@esbuild/win32-x64" "0.24.2" - -fsevents@~2.3.2, fsevents@~2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - -nanoid@^3.3.7: - version "3.3.8" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf" - integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w== - -picocolors@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" - integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== - -postcss@^8.4.49: - version "8.4.49" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.49.tgz#4ea479048ab059ab3ae61d082190fabfd994fe19" - integrity sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA== - dependencies: - nanoid "^3.3.7" - picocolors "^1.1.1" - source-map-js "^1.2.1" - -rollup@^4.23.0: - version "4.29.2" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.29.2.tgz#ff1555fd27fc20599a9b8f90527f0f43a1738e7f" - integrity sha512-tJXpsEkzsEzyAKIaB3qv3IuvTVcTN7qBw1jL4SPPXM3vzDrJgiLGFY6+HodgFaUHAJ2RYJ94zV5MKRJCoQzQeA== - dependencies: - "@types/estree" "1.0.6" - optionalDependencies: - "@rollup/rollup-android-arm-eabi" "4.29.2" - "@rollup/rollup-android-arm64" "4.29.2" - "@rollup/rollup-darwin-arm64" "4.29.2" - "@rollup/rollup-darwin-x64" "4.29.2" - "@rollup/rollup-freebsd-arm64" "4.29.2" - "@rollup/rollup-freebsd-x64" "4.29.2" - "@rollup/rollup-linux-arm-gnueabihf" "4.29.2" - "@rollup/rollup-linux-arm-musleabihf" "4.29.2" - "@rollup/rollup-linux-arm64-gnu" "4.29.2" - "@rollup/rollup-linux-arm64-musl" "4.29.2" - "@rollup/rollup-linux-loongarch64-gnu" "4.29.2" - "@rollup/rollup-linux-powerpc64le-gnu" "4.29.2" - "@rollup/rollup-linux-riscv64-gnu" "4.29.2" - "@rollup/rollup-linux-s390x-gnu" "4.29.2" - "@rollup/rollup-linux-x64-gnu" "4.29.2" - "@rollup/rollup-linux-x64-musl" "4.29.2" - "@rollup/rollup-win32-arm64-msvc" "4.29.2" - "@rollup/rollup-win32-ia32-msvc" "4.29.2" - "@rollup/rollup-win32-x64-msvc" "4.29.2" - fsevents "~2.3.2" - -source-map-js@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" - integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== - -vite@^6.0.5: - version "6.0.7" - resolved "https://registry.yarnpkg.com/vite/-/vite-6.0.7.tgz#f0f8c120733b04af52b4a1e3e7cb54eb851a799b" - integrity sha512-RDt8r/7qx9940f8FcOIAH9PTViRrghKaK2K1jY3RaAURrEUbm9Du1mJ72G+jlhtG3WwodnfzY8ORQZbBavZEAQ== - dependencies: - esbuild "^0.24.2" - postcss "^8.4.49" - rollup "^4.23.0" - optionalDependencies: - fsevents "~2.3.3" diff --git a/tsconfig.json b/tsconfig.json index 2e7cbfcbb..27b0071e9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,10 +5,11 @@ "declaration": true, "declarationMap": true, "declarationDir": "./dist/types", - "module": "node16", + "module": "nodenext", // Node.js 18 supports up to ES2022 according to https://www.npmjs.com/package/@tsconfig/node18 "target": "es2022", "lib": ["ESNext", "dom"], + "resolveJsonModule": true, "strict": true, "verbatimModuleSyntax": true } diff --git a/vite.config.js b/vite.config.ts similarity index 100% rename from vite.config.js rename to vite.config.ts From b9b45843291a9d568f94dda06864825b9da34e93 Mon Sep 17 00:00:00 2001 From: "F. Levi" <55688616+flevi29@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:22:51 +0200 Subject: [PATCH 03/10] Format README add back warning of deprecations --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c16884cc9..f9e6338fe 100644 --- a/README.md +++ b/README.md @@ -25,18 +25,32 @@

⚡ The Meilisearch API client written for JavaScript

-**Meilisearch JavaScript** is the Meilisearch API client for JavaScript developers. +**Meilisearch JavaScript** is the Meilisearch API client for JavaScript +developers. -**Meilisearch** is an open-source search engine. [Learn more about Meilisearch.](https://github.com/meilisearch/meilisearch) +**Meilisearch** is an open-source search engine. +[Learn more about Meilisearch.](https://github.com/meilisearch/meilisearch) ## 📖 Documentation -Refer to the [client library documentation](https://meilisearch.github.io/meilisearch-js/modules.html) for information on each exported item of this pacakge. +Refer to the +[client library documentation](https://meilisearch.github.io/meilisearch-js/modules.html) +for information on each exported item of this pacakge. -For general information on how to use Meilisearch—such as our API reference, tutorials, guides, and in-depth articles—refer to our [main documentation website](https://www.meilisearch.com/docs/). +For general information on how to use Meilisearch—such as our API reference, +tutorials, guides, and in-depth articles—refer to our +[main documentation website](https://www.meilisearch.com/docs/). ## 🔧 Installation +> [!WARNING] +> +> - [default export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export#using_the_default_export) +> is deprecated and will be removed in a future version +> https://github.com/meilisearch/meilisearch-js/issues/1789 +> - exports will stop being directly available on the global object (usually +> `window`) https://github.com/meilisearch/meilisearch-js/issues/1806 + ```sh npm i meilisearch # or @@ -46,28 +60,45 @@ pnpm add meilisearch ``` -Node.js [LTS and Maintenance versions](https://github.com/nodejs/Release?tab=readme-ov-file#release-schedule) should be tested and supported. -Other runtimes, like Deno and Bun aren't tested, but if they do not work with this package, pelase open an issue. +Node.js +[LTS and Maintenance versions](https://github.com/nodejs/Release?tab=readme-ov-file#release-schedule) +is supported and tested. + +Other runtimes, like Deno and Bun aren't tested, but if they do not work with +this package, pelase open an issue. ### Run Meilisearch -⚡️ **Launch, scale, and streamline in minutes with Meilisearch Cloud**—no maintenance, no commitment, cancel anytime. [Try it free now](https://cloud.meilisearch.com/login?utm_campaign=oss&utm_source=github&utm_medium=meilisearch-js). +⚡️ **Launch, scale, and streamline in minutes with Meilisearch Cloud**—no +maintenance, no commitment, cancel anytime. +[Try it free now](https://cloud.meilisearch.com/login?utm_campaign=oss&utm_source=github&utm_medium=meilisearch-js). -🪨 Prefer to self-host? [Download and deploy](https://www.meilisearch.com/docs/learn/self_hosted/getting_started_with_self_hosted_meilisearch?utm_campaign=oss&utm_source=github&utm_medium=meilisearch-js) our fast, open-source search engine on your own infrastructure. +🪨 Prefer to self-host? +[Download and deploy](https://www.meilisearch.com/docs/learn/self_hosted/getting_started_with_self_hosted_meilisearch?utm_campaign=oss&utm_source=github&utm_medium=meilisearch-js) +our fast, open-source search engine on your own infrastructure. ## 🚀 Example code -Take a look at the [playground](./playgrounds/javascript/src/meilisearch.ts) to see example code. +Take a look at the [playground](./playgrounds/javascript/src/meilisearch.ts) to +see an example. ## 🤖 Compatibility with Meilisearch -This package guarantees compatibility with the [latest version of Meilisearch](https://github.com/meilisearch/meilisearch/releases/latest). +This package guarantees compatibility with the +[latest version of Meilisearch](https://github.com/meilisearch/meilisearch/releases/latest). ## ⚙️ Contributing -We welcome all contributions, big and small! If you want to know more about this SDK's development workflow or want to contribute to the repo, please visit our [contributing guidelines](/CONTRIBUTING.md) for detailed instructions. +We welcome all contributions, big and small! If you want to know more about this +SDK's development workflow or want to contribute to the repo, please visit our +[contributing guidelines](/CONTRIBUTING.md) for detailed instructions. --- -Meilisearch provides and maintains many SDKs and integration tools like this one. We want to provide everyone with an **amazing search experience for any kind of project**. For a full overview of everything we create and maintain, take a look at the [integration-guides](https://github.com/meilisearch/integration-guides) repository. +Meilisearch provides and maintains many SDKs and integration tools like this +one. We want to provide everyone with an **amazing search experience for any +kind of project**. For a full overview of everything we create and maintain, +take a look at the +[integration-guides](https://github.com/meilisearch/integration-guides) +repository. From f91d774285ae56bf3498a82f63d4ffab6033c1ac Mon Sep 17 00:00:00 2001 From: "F. Levi" <55688616+flevi29@users.noreply.github.com> Date: Wed, 22 Jan 2025 21:03:10 +0200 Subject: [PATCH 04/10] Fix playground error display --- playgrounds/javascript/src/main.ts | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/playgrounds/javascript/src/main.ts b/playgrounds/javascript/src/main.ts index da5ed4c57..4c24c0577 100644 --- a/playgrounds/javascript/src/main.ts +++ b/playgrounds/javascript/src/main.ts @@ -11,20 +11,31 @@ document.querySelector("#app")!.innerHTML = `

Search response:

-
-

Errors:

-
None
+

Errors:

+
None
`; +function getErrorMessage(error: unknown): string { + if (!(error instanceof Error)) { + return JSON.stringify(error); + } + + const message = String(error); + + if (error.cause === undefined) { + return message; + } + + return `${message}\nCaused by ${getErrorMessage(error.cause)}`; +} + try { await addDocuments(); await getAllHits(document.querySelector("#hits")!); await getSearchResponse(document.querySelector("#response")!); } catch (error) { console.error(error); - document.querySelector("#errors")!.innerText = JSON.stringify( - error, - null, - 4, - ); + document.querySelector("#errors")!.innerText = + getErrorMessage(error); } From f4257c74b565d18e1defb1ea53b8d8dd0a5d9933 Mon Sep 17 00:00:00 2001 From: "F. Levi" <55688616+flevi29@users.noreply.github.com> Date: Thu, 23 Jan 2025 21:04:52 +0200 Subject: [PATCH 05/10] Update README.md Remove more unnecessary information --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f9e6338fe..02803ef61 100644 --- a/README.md +++ b/README.md @@ -51,20 +51,16 @@ tutorials, guides, and in-depth articles—refer to our > - exports will stop being directly available on the global object (usually > `window`) https://github.com/meilisearch/meilisearch-js/issues/1806 -```sh -npm i meilisearch -# or -yarn add meilisearch -# or -pnpm add meilisearch -``` - Node.js [LTS and Maintenance versions](https://github.com/nodejs/Release?tab=readme-ov-file#release-schedule) is supported and tested. +```sh +npm i meilisearch +``` + Other runtimes, like Deno and Bun aren't tested, but if they do not work with this package, pelase open an issue. From 7c68318e10983026a4022d7fddf93b593f9852af Mon Sep 17 00:00:00 2001 From: "F. Levi" <55688616+flevi29@users.noreply.github.com> Date: Thu, 23 Jan 2025 21:05:58 +0200 Subject: [PATCH 06/10] Update package.json Remove accidental added script --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 9d4c7a223..d0cdaf161 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,6 @@ "test:env:nodejs": "yarn build && node tests/env/node/index.cjs && node tests/env/node/getting_started.cjs", "test:env:esm": "yarn --cwd tests/env/esm && yarn --cwd tests/env/esm start", "test:env:nitro-app": "yarn build && yarn --cwd tests/env/nitro-app test", - "todo": "open issue about formatting everything that can be formatted with prettier", "fmt": "prettier -c ./**/*.{js,ts}", "fmt:fix": "prettier -w ./**/*.{js,ts}", "lint": "eslint", From 5015c4aa9bba9ecd9f0bcc5ab07ddda70f0f9ef5 Mon Sep 17 00:00:00 2001 From: "F. Levi" <55688616+flevi29@users.noreply.github.com> Date: Sun, 26 Jan 2025 10:09:31 +0200 Subject: [PATCH 07/10] Add details about TypeScript support, other adjustments --- README.md | 62 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 02803ef61..ef70c58b3 100644 --- a/README.md +++ b/README.md @@ -31,48 +31,56 @@ developers. **Meilisearch** is an open-source search engine. [Learn more about Meilisearch.](https://github.com/meilisearch/meilisearch) -## 📖 Documentation +## Run Meilisearch -Refer to the -[client library documentation](https://meilisearch.github.io/meilisearch-js/modules.html) -for information on each exported item of this pacakge. +⚡️ **Launch, scale, and streamline in minutes with Meilisearch Cloud**—no +maintenance, no commitment, cancel anytime. +[Try it free now](https://cloud.meilisearch.com/login?utm_campaign=oss&utm_source=github&utm_medium=meilisearch-js). -For general information on how to use Meilisearch—such as our API reference, -tutorials, guides, and in-depth articles—refer to our -[main documentation website](https://www.meilisearch.com/docs/). +🪨 Prefer to self-host? +[Download and deploy](https://www.meilisearch.com/docs/learn/self_hosted/getting_started_with_self_hosted_meilisearch?utm_campaign=oss&utm_source=github&utm_medium=meilisearch-js) +our fast, open-source search engine on your own infrastructure. ## 🔧 Installation -> [!WARNING] -> -> - [default export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export#using_the_default_export) -> is deprecated and will be removed in a future version -> https://github.com/meilisearch/meilisearch-js/issues/1789 -> - exports will stop being directly available on the global object (usually -> `window`) https://github.com/meilisearch/meilisearch-js/issues/1806 - - +Package is published to [npm](https://www.npmjs.com/package/meilisearch). -Node.js -[LTS and Maintenance versions](https://github.com/nodejs/Release?tab=readme-ov-file#release-schedule) -is supported and tested. +Installing with `npm`: ```sh npm i meilisearch ``` +> [!NOTE] +> +> Node.js +> [LTS and Maintenance versions](https://github.com/nodejs/Release?tab=readme-ov-file#release-schedule) +> are supported and tested. Other versions may or may not work. +> [TypeScript has to be set up so that it supports `package.json` `"exports"` field](https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports). + Other runtimes, like Deno and Bun aren't tested, but if they do not work with -this package, pelase open an issue. +this package, please open an issue. -### Run Meilisearch +> [!WARNING] +> +> - [default export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export#using_the_default_export) +> is deprecated and will be removed in a future version | +> [Issue](https://github.com/meilisearch/meilisearch-js/issues/1789) +> - regarding usage of packages through +> [`script src`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#src), +> exports will stop being directly available on the +> [global object](https://developer.mozilla.org/en-US/docs/Glossary/Global_object) +> | [Issue](https://github.com/meilisearch/meilisearch-js/issues/1806) -⚡️ **Launch, scale, and streamline in minutes with Meilisearch Cloud**—no -maintenance, no commitment, cancel anytime. -[Try it free now](https://cloud.meilisearch.com/login?utm_campaign=oss&utm_source=github&utm_medium=meilisearch-js). +## 📖 Documentation -🪨 Prefer to self-host? -[Download and deploy](https://www.meilisearch.com/docs/learn/self_hosted/getting_started_with_self_hosted_meilisearch?utm_campaign=oss&utm_source=github&utm_medium=meilisearch-js) -our fast, open-source search engine on your own infrastructure. +Refer to the +[client library documentation](https://meilisearch.github.io/meilisearch-js/modules.html) +for information on each exported item of this package. + +For general information on how to use Meilisearch—such as our API reference, +tutorials, guides, and in-depth articles—refer to our +[main documentation website](https://www.meilisearch.com/docs/). ## 🚀 Example code From fafbc0da9cdf706e1df476b50ba133971367c95c Mon Sep 17 00:00:00 2001 From: "F. Levi" <55688616+flevi29@users.noreply.github.com> Date: Sun, 26 Jan 2025 10:11:15 +0200 Subject: [PATCH 08/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef70c58b3..958cd44ca 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ npm i meilisearch > are supported and tested. Other versions may or may not work. > [TypeScript has to be set up so that it supports `package.json` `"exports"` field](https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports). -Other runtimes, like Deno and Bun aren't tested, but if they do not work with +Other runtimes, like Deno and Bun, aren't tested, but if they do not work with this package, please open an issue. > [!WARNING] From b2d18a6c46514dc60c6badea940f4368ffc1e184 Mon Sep 17 00:00:00 2001 From: "F. Levi" <55688616+flevi29@users.noreply.github.com> Date: Sun, 26 Jan 2025 10:15:44 +0200 Subject: [PATCH 09/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 958cd44ca..ac3571711 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ this package, please open an issue. > - [default export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export#using_the_default_export) > is deprecated and will be removed in a future version | > [Issue](https://github.com/meilisearch/meilisearch-js/issues/1789) -> - regarding usage of packages through +> - regarding usage of package through > [`script src`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#src), > exports will stop being directly available on the > [global object](https://developer.mozilla.org/en-US/docs/Glossary/Global_object) From 42d02c21d63f61c9b48d731336a417049e038478 Mon Sep 17 00:00:00 2001 From: "F. Levi" <55688616+flevi29@users.noreply.github.com> Date: Mon, 27 Jan 2025 10:33:23 +0200 Subject: [PATCH 10/10] Add mention of UMD bundle --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ac3571711..41e9f25f4 100644 --- a/README.md +++ b/README.md @@ -61,14 +61,26 @@ npm i meilisearch Other runtimes, like Deno and Bun, aren't tested, but if they do not work with this package, please open an issue. +This package also contains a [UMD](https://stackoverflow.com/a/77284527) bundled +version, which is meant to be used in a +[`script src`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#src) +tag: + +```html + + +``` + > [!WARNING] > > - [default export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export#using_the_default_export) > is deprecated and will be removed in a future version | > [Issue](https://github.com/meilisearch/meilisearch-js/issues/1789) -> - regarding usage of package through -> [`script src`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#src), -> exports will stop being directly available on the +> - regarding usage of package's UMD version via `script src`, exports will stop +> being directly available on the > [global object](https://developer.mozilla.org/en-US/docs/Glossary/Global_object) > | [Issue](https://github.com/meilisearch/meilisearch-js/issues/1806)