firestore-meilisearch 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -119,7 +119,7 @@ firebase ext:install meilisearch/firestore-meilisearch --project=[your-project-i
119
119
 
120
120
  ## 🤖 Compatibility with Meilisearch
121
121
 
122
- This package only guarantees the compatibility with the [version v0.27.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.27.0).
122
+ This package only guarantees the compatibility with the [version v0.28.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.28.0).
123
123
 
124
124
  ## ⚙️ Development Workflow and Contributing
125
125
 
@@ -5,6 +5,7 @@ import { mockConsoleLog, mockConsoleInfo } from './__mocks__/console'
5
5
  import { MeiliSearch } from 'meilisearch'
6
6
  import defaultEnvironment from './data/environment'
7
7
  import defaultDocument from './data/document'
8
+ import { version } from '../src/version'
8
9
 
9
10
  jest.mock('meilisearch')
10
11
 
@@ -52,6 +53,7 @@ describe('extension', () => {
52
53
  expect(mockedMeilisearch).toHaveBeenCalledWith({
53
54
  apiKey: defaultEnvironment.MEILISEARCH_API_KEY,
54
55
  host: defaultEnvironment.MEILISEARCH_HOST,
56
+ clientAgents: [`Meilisearch Firebase (v${version})`],
55
57
  })
56
58
  expect(mockConsoleLog).toBeCalledWith(
57
59
  'Initializing extension with configuration',
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.constructClientAgents = void 0;
4
+ const version_1 = require("../version");
5
+ const constructClientAgents = (clientAgents = []) => {
6
+ const firebaseAgent = `Meilisearch Firebase (v${version_1.version})`;
7
+ return clientAgents.concat(firebaseAgent);
8
+ };
9
+ exports.constructClientAgents = constructClientAgents;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initMeilisearchIndex = void 0;
4
4
  const meilisearch_1 = require("meilisearch");
5
+ const agents_1 = require("./agents");
5
6
  /**
6
7
  * initMeilisearchIndex
7
8
  * @param {MeilisearchConfig} - Meilisearch configuration
@@ -11,6 +12,7 @@ function initMeilisearchIndex({ host, apiKey, indexUid, }) {
11
12
  const client = new meilisearch_1.MeiliSearch({
12
13
  host,
13
14
  apiKey,
15
+ clientAgents: (0, agents_1.constructClientAgents)(),
14
16
  });
15
17
  return client.index(indexUid);
16
18
  }
package/lib/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- exports.version = '0.1.4';
4
+ exports.version = '0.1.5';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firestore-meilisearch",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "scripts": {
5
5
  "lint": "eslint .",
6
6
  "lint:fix": "eslint . --fix",
@@ -25,7 +25,7 @@
25
25
  "firebase-admin": "^9.8.0",
26
26
  "firebase-functions": "^3.16.0",
27
27
  "inquirer": "^8.2.2",
28
- "meilisearch": "^0.25.1"
28
+ "meilisearch": "^0.27.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@babel/preset-typescript": "^7.15.0",
@@ -0,0 +1,9 @@
1
+ import { version } from '../version'
2
+
3
+ export const constructClientAgents = (
4
+ clientAgents: string[] = []
5
+ ): string[] => {
6
+ const firebaseAgent = `Meilisearch Firebase (v${version})`
7
+
8
+ return clientAgents.concat(firebaseAgent)
9
+ }
@@ -1,5 +1,6 @@
1
1
  import { MeiliSearch, Index } from 'meilisearch'
2
2
  import { MeilisearchConfig } from '../types'
3
+ import { constructClientAgents } from './agents'
3
4
 
4
5
  /**
5
6
  * initMeilisearchIndex
@@ -14,6 +15,7 @@ export function initMeilisearchIndex({
14
15
  const client = new MeiliSearch({
15
16
  host,
16
17
  apiKey,
18
+ clientAgents: constructClientAgents(),
17
19
  })
18
20
 
19
21
  return client.index(indexUid)
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '0.1.4'
1
+ export const version = '0.1.5'