Skip to content

Commit 0e43e97

Browse files
authored
Merge branch 'main' into feat/native-fetch-with-nitro-support
2 parents e0f8103 + ed73bdf commit 0e43e97

File tree

7 files changed

+171
-103
lines changed

7 files changed

+171
-103
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Instead of using a package manager, you may also import the library directly int
5757

5858
### Run Meilisearch <!-- omit in toc -->
5959

60-
To use one of our SDKs, you must first have a running Meilisearch instance. Consult our documentation for [instructions on how to download and launch Meilisearch](https://docs.meilisearch.com/reference/features/installation.html#download-and-launch).
60+
To use one of our SDKs, you must first have a running Meilisearch instance. Consult our documentation for [instructions on how to download and launch Meilisearch](https://www.meilisearch.com/docs/learn/getting_started/installation#installation).
6161

6262
### Import <!-- omit in toc -->
6363

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meilisearch",
3-
"version": "0.32.3",
3+
"version": "0.32.5",
44
"description": "The Meilisearch JS client for Node.js and the browser.",
55
"keywords": [
66
"meilisearch",
@@ -44,7 +44,7 @@
4444
"test:ci": "yarn test --ci",
4545
"test:env": "yarn build && yarn test:env:nodejs && yarn test:env:esm && yarn test:env:node-ts",
4646
"test:env:node-ts": "yarn --cwd tests/env/typescript-node start",
47-
"test:env:nodejs": "node tests/env/node/index.js",
47+
"test:env:nodejs": "yarn build && node tests/env/node/index.js && node tests/env/node/getting_started.js",
4848
"test:env:esm": "yarn --cwd tests/env/esm && yarn --cwd tests/env/esm start",
4949
"test:env:nitro-app": "yarn build && yarn --cwd tests/env/nitro-app test",
5050
"size": "node scripts/file-size ./dist/bundles/meilisearch.esm.min.js ./dist/bundles/meilisearch.umd.min.js",
@@ -70,14 +70,14 @@
7070
]
7171
},
7272
"dependencies": {
73-
"cross-fetch": "^3.1.5"
73+
"cross-fetch": "^3.1.6"
7474
},
7575
"devDependencies": {
76-
"@babel/preset-env": "^7.21.4",
76+
"@babel/preset-env": "^7.21.5",
7777
"@rollup/plugin-babel": "^6.0.3",
78-
"@rollup/plugin-commonjs": "24.0.1",
78+
"@rollup/plugin-commonjs": "25.0.0",
7979
"@rollup/plugin-json": "^6.0.0",
80-
"@rollup/plugin-node-resolve": "15.0.1",
80+
"@rollup/plugin-node-resolve": "15.0.2",
8181
"@types/jest": "^27.5.0",
8282
"@types/prettier": "^2.2.3",
8383
"@typescript-eslint/eslint-plugin": "2.34.0",

src/package-version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const PACKAGE_VERSION = '0.32.3'
1+
export const PACKAGE_VERSION = '0.32.5'

src/token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function createPayload(payloadParams: {
112112
const payload = {
113113
searchRules,
114114
apiKeyUid: uid,
115-
exp: expiresAt?.getTime(),
115+
exp: expiresAt ? Math.floor(expiresAt.getTime() / 1000) : undefined,
116116
}
117117

118118
return encode64(payload).replace(/=/g, '')

tests/env/node/getting_started.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const { MeiliSearch } = require('../../../dist/bundles/meilisearch.umd.js')
2121
// If the index 'movies' does not exist, MeiliSearch creates it when you first add the documents.
2222
await index.updateFilterableAttributes([
2323
'director',
24-
'genres'
24+
'genres',
25+
'id'
2526
])
2627

2728
let response = await index.addDocuments(dataset)

tests/token.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ describe.each([{ permission: 'Admin' }])(
160160
const [_, payload] = token.split('.')
161161
const searchClient = new MeiliSearch({ host: HOST, apiKey: token })
162162

163-
expect(JSON.parse(decode64(payload)).exp).toEqual(date.getTime())
163+
expect(JSON.parse(decode64(payload)).exp).toEqual(
164+
Math.floor(date.getTime() / 1000)
165+
)
164166
expect(searchClient.index(UID).search()).resolves.not.toBeUndefined()
165167
})
166168

yarn.lock

Lines changed: 157 additions & 92 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)