@stacksjs/search-engine 0.70.23 → 0.70.25

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.
@@ -0,0 +1,2 @@
1
+ import type { Err, Ok } from '@stacksjs/error-handling';
2
+ export declare function importModelDocuments(modelOption?: string): Promise<Ok<string, never> | Err<string, any>>;
@@ -0,0 +1,2 @@
1
+ import type { Err, Ok } from '@stacksjs/error-handling';
2
+ export declare function flushModelDocuments(modelOption?: string): Promise<Ok<string, never> | Err<string, any>>;
@@ -0,0 +1,2 @@
1
+ import type { Err, Ok } from '@stacksjs/error-handling';
2
+ export declare function listIndexSettings(modelName: string): Promise<Ok<string, never> | Err<string, any>>;
@@ -0,0 +1,4 @@
1
+ export * from './add';
2
+ export * from './flush';
3
+ export * from './index-list';
4
+ export * from './settings';
@@ -0,0 +1,2 @@
1
+ import type { Err, Ok } from '@stacksjs/error-handling';
2
+ export declare function updateIndexSettings(): Promise<Ok<string, never> | Err<string, any>>;
@@ -0,0 +1,11 @@
1
+ import algolia from './drivers/algolia';
2
+ import meilisearch from './drivers/meilisearch';
3
+ import opensearch from './drivers/opensearch';
4
+ import type { SearchEngineDriver } from '@stacksjs/types';
5
+ export declare function useSearchEngine(): SearchEngineDriver;
6
+ export declare function useAlgolia(): typeof algolia;
7
+ export declare function useMeilisearch(): typeof meilisearch;
8
+ export declare function useOpensearch(): typeof opensearch;
9
+ export type SearchDriver = 'meilisearch' | 'algolia' | 'opensearch';
10
+ export * from './documents';
11
+ export { algolia, meilisearch, opensearch };
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@stacksjs/search-engine",
3
3
  "type": "module",
4
- "version": "0.70.23",
4
+ "version": "0.70.25",
5
5
  "description": "The Stacks search engine integrations.",
6
6
  "author": "Chris Breuer",
7
- "contributors": ["Chris Breuer <chris@stacksjs.org>"],
7
+ "contributors": [
8
+ "Chris Breuer <chris@stacksjs.com>"
9
+ ],
8
10
  "license": "MIT",
9
11
  "funding": "https://github.com/sponsors/chrisbbreuer",
10
12
  "homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/search-engine#readme",
@@ -31,24 +33,28 @@
31
33
  ],
32
34
  "exports": {
33
35
  ".": {
36
+ "bun": "./src/index.ts",
37
+ "types": "./dist/index.d.ts",
34
38
  "import": "./dist/index.js"
35
39
  },
36
40
  "./*": {
41
+ "bun": "./src/*",
37
42
  "import": "./dist/*"
38
43
  }
39
44
  },
40
45
  "module": "dist/index.js",
41
46
  "types": "dist/index.d.ts",
42
- "files": ["README.md", "dist"],
47
+ "files": [
48
+ "README.md",
49
+ "dist"
50
+ ],
43
51
  "scripts": {
44
52
  "build": "bun build.ts",
45
53
  "typecheck": "bun tsc --noEmit",
46
54
  "prepublishOnly": "bun run build"
47
55
  },
48
56
  "devDependencies": {
49
- "@opensearch-project/opensearch": "^3.4.0",
50
- "@stacksjs/config": "0.70.22",
51
- "@stacksjs/development": "0.70.22",
52
- "meilisearch": "^0.49.0"
57
+ "@stacksjs/config": "0.70.23",
58
+ "better-dx": "^0.2.12"
53
59
  }
54
60
  }
package/dist/add.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { Err } from '@stacksjs/error-handling';
2
-
3
- export declare function importModelDocuments(modelOption?: string): Promise<Ok<string, never> | Err<string, any>>;
package/dist/flush.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { Err } from '@stacksjs/error-handling';
2
-
3
- export declare function flushModelDocuments(modelOption?: string): Promise<Ok<string, never> | Err<string, any>>;
package/dist/helpers.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import type { SearchEngineStore } from './types';
2
-
3
- export declare function isString(val: unknown): val is string;
4
- export declare function determineState(): SearchEngineStore;
@@ -1,3 +0,0 @@
1
- import type { Err } from '@stacksjs/error-handling';
2
-
3
- export declare function listIndexSettings(modelName: string): Promise<Ok<string, never> | Err<string, any>>;
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from './add'
2
- export * from './flush'
3
- export * from './index-list'
4
- export * from './settings'
@@ -1,58 +0,0 @@
1
- import type { Dictionary, DocumentOptions, EnqueuedTask, Faceting, IndexOptions, PaginationSettings, Settings, Synonyms, TypoTolerance } from 'meilisearch';
2
- import type { SearchEngineDriver } from '@stacksjs/types';
3
-
4
- declare function client(): Meilisearch;
5
- declare function search(index: string, params: any): Promise<SearchResponse<Record<string, any>>>;
6
- declare function addDocument(indexName: string, params: any): Promise<EnqueuedTask>;
7
- declare function addDocuments(indexName: string, params: any[]): Promise<EnqueuedTask>;
8
- declare function getIndex(name: string): Promise<Index<Record<string, any>>>;
9
- declare function createIndex(name: string, options?: IndexOptions): Promise<EnqueuedTask>;
10
- declare function updateIndex(indexName: string, params: IndexOptions): Promise<EnqueuedTask>;
11
- declare function updateDocument(indexName: string, params: DocumentOptions): Promise<EnqueuedTask>;
12
- declare function updateDocuments(indexName: string, params: DocumentOptions[]): Promise<EnqueuedTask>;
13
- declare function deleteDocument(indexName: string, id: number): Promise<EnqueuedTask>;
14
- declare function deleteDocuments(indexName: string, filters: string | string[]): Promise<EnqueuedTask>;
15
- declare function getDocument(indexName: string, id: number, fields: any): Promise<EnqueuedTask>;
16
- declare function deleteIndex(indexName: string): Promise<EnqueuedTask>;
17
- declare function listAllIndexes(): Promise<IndexesResults<Index[]>>;
18
- declare function getFilterableAttributes(index: string): Promise<string[]>;
19
- declare function updateFilterableAttributes(index: string, filterableAttributes: string[] | null): Promise<EnqueuedTask>;
20
- declare function resetFilterableAttributes(index: string): Promise<EnqueuedTask>;
21
- declare function updateSearchableAttributes(index: string, searchableAttributes: string[] | null): Promise<EnqueuedTask>;
22
- declare function resetSearchableAttributes(index: string): Promise<EnqueuedTask>;
23
- declare function getSearchableAttributes(index: string): Promise<string[]>;
24
- declare function updateSortableAttributes(index: string, sortableAttributes: string[] | null): Promise<EnqueuedTask>;
25
- declare function resetSortableAttributes(index: string): Promise<EnqueuedTask>;
26
- declare function getSortableAttributes(index: string): Promise<string[]>;
27
- declare function updateDisplayedAttributes(index: string, displayedAttributes: string[] | null): Promise<EnqueuedTask>;
28
- declare function getDisplayedAttributes(index: string): Promise<string[]>;
29
- declare function resetDisplayedAttributes(index: string): Promise<EnqueuedTask>;
30
- declare function getSettings(index: string): Promise<Settings>;
31
- declare function updateSettings(index: string, settings: Settings): Promise<EnqueuedTask>;
32
- declare function resetSettings(index: string): Promise<EnqueuedTask>;
33
- declare function getPagination(index: string): Promise<PaginationSettings>;
34
- declare function updatePagination(index: string, pagination: PaginationSettings): Promise<EnqueuedTask>;
35
- declare function resetPagination(index: string): Promise<EnqueuedTask>;
36
- declare function getSynonyms(index: string): Promise<object>;
37
- declare function updateSynonyms(index: string, synonyms: Synonyms): Promise<EnqueuedTask>;
38
- declare function resetSynonyms(index: string): Promise<EnqueuedTask>;
39
- declare function getRankingRules(index: string): Promise<string[]>;
40
- declare function updateRankingRules(index: string, rankingRules: string[] | null): Promise<EnqueuedTask>;
41
- declare function resetRankingRules(index: string): Promise<EnqueuedTask>;
42
- declare function getDistinctAttribute(index: string): Promise<string | null>;
43
- declare function updateDistinctAttribute(index: string, distinctAttribute: string | null): Promise<EnqueuedTask>;
44
- declare function resetDistinctAttribute(index: string): Promise<EnqueuedTask>;
45
- declare function getFaceting(index: string): Promise<Faceting>;
46
- declare function updateFaceting(index: string, faceting: Faceting): Promise<EnqueuedTask>;
47
- declare function resetFaceting(index: string): Promise<EnqueuedTask>;
48
- declare function getTypoTolerance(index: string): Promise<TypoTolerance>;
49
- declare function updateTypoTolerance(index: string, typoTolerance: TypoTolerance | null): Promise<EnqueuedTask>;
50
- declare function resetTypoTolerance(index: string): Promise<EnqueuedTask>;
51
- declare function getDictionary(index: string): Promise<Dictionary>;
52
- declare function updateDictionary(index: string, dictionary: Dictionary | null): Promise<EnqueuedTask>;
53
- declare function resetDictionary(index: string): Promise<EnqueuedTask>;
54
- declare function convertToFilter(jsonData: any): string[];
55
- declare function convertToMeilisearchSorting(jsonData: any): string[];
56
- declare const meilisearch: SearchEngineDriver;
57
-
58
- export default meilisearch;
@@ -1,3 +0,0 @@
1
- import type { Err } from '@stacksjs/error-handling';
2
-
3
- export declare function updateIndexSettings(): Promise<Ok<string, never> | Err<string, any>>;
package/dist/types.d.ts DELETED
@@ -1,37 +0,0 @@
1
- import type { Hits, SearchResponse } from 'meilisearch';
2
-
3
- export declare interface SearchEngineStore {
4
- index: string
5
- source?: string
6
- password?: string
7
- query?: string
8
- perPage?: number
9
- currentPage?: number
10
- results?: SearchResponse<Record<string, any>>
11
- hits?: Hits<Record<string, any>>
12
-
13
- filterName?: string
14
-
15
- filters?: object
16
-
17
- goToNextPage?: number
18
-
19
- goToPage?: number
20
-
21
- goToPrevPage?: number
22
-
23
- lastPageNumber?: number
24
-
25
- search?: string
26
-
27
- searchFilters?: object
28
-
29
- searchParams?: object
30
-
31
- setTotalHits?: number
32
-
33
- sort?: string
34
-
35
- sorts?: object
36
-
37
- }