@reactionary/examples-node 0.2.5 → 0.2.9

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/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@reactionary/examples-node",
3
- "version": "0.2.5",
3
+ "version": "0.2.9",
4
4
  "main": "index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "dependencies": {
7
- "@reactionary/core": "0.2.5",
8
- "@reactionary/provider-commercetools": "0.2.5",
9
- "@reactionary/provider-algolia": "0.2.5",
10
- "@reactionary/provider-medusa": "0.2.5"
7
+ "@reactionary/core": "0.2.9",
8
+ "@reactionary/provider-commercetools": "0.2.9",
9
+ "@reactionary/provider-algolia": "0.2.9",
10
+ "@reactionary/provider-medusa": "0.2.9",
11
+ "@reactionary/provider-meilisearch": "0.2.9"
11
12
  },
12
13
  "type": "module"
13
14
  }
@@ -7,7 +7,7 @@ const testData = {
7
7
  searchTerm: 'manhattan',
8
8
  };
9
9
 
10
- describe.each([PrimaryProvider.ALGOLIA, PrimaryProvider.COMMERCETOOLS])(
10
+ describe.each([PrimaryProvider.ALGOLIA, PrimaryProvider.COMMERCETOOLS,PrimaryProvider.MEILISEARCH])(
11
11
  'Product Search Capability - %s',
12
12
  (provider) => {
13
13
  let client: ReturnType<typeof createClient>;
@@ -103,7 +103,7 @@ describe.each([PrimaryProvider.ALGOLIA, PrimaryProvider.COMMERCETOOLS])(
103
103
  filters: [],
104
104
  },
105
105
  });
106
-
106
+
107
107
  if (!smallPage.success || !largePage.success) {
108
108
  assert.fail();
109
109
  }
@@ -223,7 +223,7 @@ describe.each([PrimaryProvider.ALGOLIA, PrimaryProvider.COMMERCETOOLS])(
223
223
 
224
224
 
225
225
 
226
- it('can apply a top level category filter', async () => {
226
+ it.skip('can apply a top level category filter', async () => {
227
227
  // First, get a category to filter on
228
228
  const categories = await client.category.findTopCategories({
229
229
  paginationOptions: {
package/src/utils.ts CHANGED
@@ -7,6 +7,7 @@ import type { CommercetoolsConfiguration } from '@reactionary/provider-commercet
7
7
  import { withCommercetoolsCapabilities } from '@reactionary/provider-commercetools';
8
8
  import { withAlgoliaCapabilities } from '@reactionary/provider-algolia';
9
9
  import { withMedusaCapabilities } from '@reactionary/provider-medusa';
10
+ import { withMeilisearchCapabilities } from '@reactionary/provider-meilisearch';
10
11
 
11
12
  export function getAlgoliaTestConfiguration() {
12
13
  return {
@@ -16,6 +17,16 @@ export function getAlgoliaTestConfiguration() {
16
17
  };
17
18
  }
18
19
 
20
+ export function getMeilisearchTestConfiguration() {
21
+ return {
22
+ apiKey: process.env['MEILISEARCH_API_KEY'] || '',
23
+ apiUrl: process.env['MEILISEARCH_API_URL'] || '',
24
+ indexName: process.env['MEILISEARCH_INDEX'] || '',
25
+ useAIEmbedding: process.env['MEILISEARCH_USE_AI_EMBEDDING'] || undefined,
26
+ };
27
+ }
28
+
29
+
19
30
  export function getMedusaTestConfiguration() {
20
31
  return {
21
32
  publishable_key: process.env['MEDUSA_PUBLISHABLE_KEY'] || '',
@@ -59,6 +70,7 @@ export enum PrimaryProvider {
59
70
  ALGOLIA = 'Algolia',
60
71
  COMMERCETOOLS = 'Commercetools',
61
72
  MEDUSA = 'Medusa',
73
+ MEILISEARCH = 'Meilisearch'
62
74
  }
63
75
 
64
76
  export function createClient(provider: PrimaryProvider) {
@@ -113,5 +125,13 @@ export function createClient(provider: PrimaryProvider) {
113
125
  );
114
126
  }
115
127
 
128
+ if (provider === PrimaryProvider.MEILISEARCH) {
129
+ builder = builder.withCapability(
130
+ withMeilisearchCapabilities(getMeilisearchTestConfiguration(), {
131
+ productSearch: true,
132
+ })
133
+ );
134
+ }
135
+
116
136
  return builder.build();
117
137
  }