@86d-app/search 0.0.3 → 0.0.6
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/.turbo/turbo-build.log +1 -0
- package/AGENTS.md +72 -0
- package/README.md +172 -30
- package/dist/__tests__/controllers.test.d.ts +2 -0
- package/dist/__tests__/controllers.test.d.ts.map +1 -0
- package/dist/__tests__/embedding-provider.test.d.ts +2 -0
- package/dist/__tests__/embedding-provider.test.d.ts.map +1 -0
- package/dist/__tests__/endpoint-security.test.d.ts +2 -0
- package/dist/__tests__/endpoint-security.test.d.ts.map +1 -0
- package/dist/__tests__/meilisearch-provider.test.d.ts +2 -0
- package/dist/__tests__/meilisearch-provider.test.d.ts.map +1 -0
- package/dist/__tests__/service-impl.test.d.ts +2 -0
- package/dist/__tests__/service-impl.test.d.ts.map +1 -0
- package/dist/admin/components/index.d.ts +2 -0
- package/dist/admin/components/index.d.ts.map +1 -0
- package/dist/admin/components/search-analytics.d.ts +2 -0
- package/dist/admin/components/search-analytics.d.ts.map +1 -0
- package/dist/admin/endpoints/analytics.d.ts +15 -0
- package/dist/admin/endpoints/analytics.d.ts.map +1 -0
- package/dist/admin/endpoints/bulk-index.d.ts +20 -0
- package/dist/admin/endpoints/bulk-index.d.ts.map +1 -0
- package/dist/admin/endpoints/click-analytics.d.ts +7 -0
- package/dist/admin/endpoints/click-analytics.d.ts.map +1 -0
- package/dist/admin/endpoints/get-settings.d.ts +17 -0
- package/dist/admin/endpoints/get-settings.d.ts.map +1 -0
- package/dist/admin/endpoints/index-manage.d.ts +26 -0
- package/dist/admin/endpoints/index-manage.d.ts.map +1 -0
- package/dist/admin/endpoints/index.d.ts +125 -0
- package/dist/admin/endpoints/index.d.ts.map +1 -0
- package/dist/admin/endpoints/popular.d.ts +10 -0
- package/dist/admin/endpoints/popular.d.ts.map +1 -0
- package/dist/admin/endpoints/synonyms.d.ts +30 -0
- package/dist/admin/endpoints/synonyms.d.ts.map +1 -0
- package/dist/admin/endpoints/zero-results.d.ts +10 -0
- package/dist/admin/endpoints/zero-results.d.ts.map +1 -0
- package/dist/embedding-provider.d.ts +28 -0
- package/dist/embedding-provider.d.ts.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/meilisearch-provider.d.ts +104 -0
- package/dist/meilisearch-provider.d.ts.map +1 -0
- package/dist/schema.d.ts +133 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/service-impl.d.ts +6 -0
- package/dist/service-impl.d.ts.map +1 -0
- package/dist/service.d.ts +127 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/store/components/_hooks.d.ts +6 -0
- package/dist/store/components/_hooks.d.ts.map +1 -0
- package/dist/store/components/index.d.ts +10 -0
- package/dist/store/components/index.d.ts.map +1 -0
- package/dist/store/components/search-bar.d.ts +7 -0
- package/dist/store/components/search-bar.d.ts.map +1 -0
- package/dist/store/components/search-page.d.ts +4 -0
- package/dist/store/components/search-page.d.ts.map +1 -0
- package/dist/store/components/search-results.d.ts +9 -0
- package/dist/store/components/search-results.d.ts.map +1 -0
- package/dist/store/endpoints/click.d.ts +14 -0
- package/dist/store/endpoints/click.d.ts.map +1 -0
- package/dist/store/endpoints/index.d.ts +85 -0
- package/dist/store/endpoints/index.d.ts.map +1 -0
- package/dist/store/endpoints/recent.d.ts +15 -0
- package/dist/store/endpoints/recent.d.ts.map +1 -0
- package/dist/store/endpoints/search.d.ts +36 -0
- package/dist/store/endpoints/search.d.ts.map +1 -0
- package/dist/store/endpoints/store-search.d.ts +16 -0
- package/dist/store/endpoints/store-search.d.ts.map +1 -0
- package/dist/store/endpoints/suggest.d.ts +11 -0
- package/dist/store/endpoints/suggest.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/__tests__/controllers.test.ts +1026 -0
- package/src/__tests__/embedding-provider.test.ts +195 -0
- package/src/__tests__/endpoint-security.test.ts +300 -0
- package/src/__tests__/meilisearch-provider.test.ts +400 -0
- package/src/__tests__/service-impl.test.ts +341 -8
- package/src/admin/components/search-analytics.tsx +120 -0
- package/src/admin/endpoints/bulk-index.ts +34 -0
- package/src/admin/endpoints/click-analytics.ts +16 -0
- package/src/admin/endpoints/get-settings.ts +56 -0
- package/src/admin/endpoints/index-manage.ts +4 -1
- package/src/admin/endpoints/index.ts +6 -0
- package/src/admin/endpoints/synonyms.ts +1 -1
- package/src/embedding-provider.ts +99 -0
- package/src/index.ts +60 -4
- package/src/meilisearch-provider.ts +239 -0
- package/src/schema.ts +15 -0
- package/src/service-impl.ts +605 -34
- package/src/service.ts +60 -1
- package/src/store/endpoints/click.ts +21 -0
- package/src/store/endpoints/index.ts +2 -0
- package/src/store/endpoints/search.ts +38 -10
- package/src/store/endpoints/suggest.ts +2 -2
- package/vitest.config.ts +2 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export declare const storeEndpoints: {
|
|
2
|
+
"/search/store-search": import("better-call").StrictEndpoint<"/search/store-search", {
|
|
3
|
+
method: "GET";
|
|
4
|
+
query: import("zod").ZodObject<{
|
|
5
|
+
q: import("zod").ZodString;
|
|
6
|
+
limit: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
|
+
}, import("zod/v4/core").$strip>;
|
|
8
|
+
}, {
|
|
9
|
+
results: {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
href: string;
|
|
13
|
+
group: string;
|
|
14
|
+
}[];
|
|
15
|
+
}>;
|
|
16
|
+
"/search": import("better-call").StrictEndpoint<"/search", {
|
|
17
|
+
method: "GET";
|
|
18
|
+
query: import("zod").ZodObject<{
|
|
19
|
+
q: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
|
|
20
|
+
type: import("zod").ZodOptional<import("zod").ZodString>;
|
|
21
|
+
tags: import("zod").ZodOptional<import("zod").ZodString>;
|
|
22
|
+
sort: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
23
|
+
relevance: "relevance";
|
|
24
|
+
newest: "newest";
|
|
25
|
+
oldest: "oldest";
|
|
26
|
+
title_asc: "title_asc";
|
|
27
|
+
title_desc: "title_desc";
|
|
28
|
+
}>>;
|
|
29
|
+
fuzzy: import("zod").ZodOptional<import("zod").ZodCoercedBoolean<unknown>>;
|
|
30
|
+
limit: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
|
|
31
|
+
skip: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
|
|
32
|
+
sessionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
33
|
+
}, import("zod/v4/core").$strip>;
|
|
34
|
+
}, {
|
|
35
|
+
results: {
|
|
36
|
+
id: string;
|
|
37
|
+
entityType: string;
|
|
38
|
+
entityId: string;
|
|
39
|
+
title: string;
|
|
40
|
+
url: string;
|
|
41
|
+
image: string | undefined;
|
|
42
|
+
tags: string[];
|
|
43
|
+
score: number;
|
|
44
|
+
highlights: import("../..").SearchHighlight | undefined;
|
|
45
|
+
}[];
|
|
46
|
+
total: number;
|
|
47
|
+
facets: import("../..").SearchFacets;
|
|
48
|
+
didYouMean: string | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
"/search/suggest": import("better-call").StrictEndpoint<"/search/suggest", {
|
|
51
|
+
method: "GET";
|
|
52
|
+
query: import("zod").ZodObject<{
|
|
53
|
+
q: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
|
|
54
|
+
limit: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
|
|
55
|
+
}, import("zod/v4/core").$strip>;
|
|
56
|
+
}, {
|
|
57
|
+
suggestions: string[];
|
|
58
|
+
}>;
|
|
59
|
+
"/search/recent": import("better-call").StrictEndpoint<"/search/recent", {
|
|
60
|
+
method: "GET";
|
|
61
|
+
query: import("zod").ZodObject<{
|
|
62
|
+
sessionId: import("zod").ZodString;
|
|
63
|
+
limit: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
|
|
64
|
+
}, import("zod/v4/core").$strip>;
|
|
65
|
+
}, {
|
|
66
|
+
recent: {
|
|
67
|
+
term: string;
|
|
68
|
+
resultCount: number;
|
|
69
|
+
searchedAt: Date;
|
|
70
|
+
}[];
|
|
71
|
+
}>;
|
|
72
|
+
"/search/click": import("better-call").StrictEndpoint<"/search/click", {
|
|
73
|
+
method: "POST";
|
|
74
|
+
body: import("zod").ZodObject<{
|
|
75
|
+
queryId: import("zod").ZodString;
|
|
76
|
+
term: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
|
|
77
|
+
entityType: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
|
|
78
|
+
entityId: import("zod").ZodString;
|
|
79
|
+
position: import("zod").ZodNumber;
|
|
80
|
+
}, import("zod/v4/core").$strip>;
|
|
81
|
+
}, {
|
|
82
|
+
id: string;
|
|
83
|
+
}>;
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/store/endpoints/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM1B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "@86d-app/core";
|
|
2
|
+
export declare const recentEndpoint: import("better-call").StrictEndpoint<"/search/recent", {
|
|
3
|
+
method: "GET";
|
|
4
|
+
query: z.ZodObject<{
|
|
5
|
+
sessionId: z.ZodString;
|
|
6
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
}, {
|
|
9
|
+
recent: {
|
|
10
|
+
term: string;
|
|
11
|
+
resultCount: number;
|
|
12
|
+
searchedAt: Date;
|
|
13
|
+
}[];
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=recent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recent.d.ts","sourceRoot":"","sources":["../../../src/store/endpoints/recent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,CAAC,EAAE,MAAM,eAAe,CAAC;AAGvD,eAAO,MAAM,cAAc;;;;;;;;;;;;EAuB1B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "@86d-app/core";
|
|
2
|
+
export declare const searchEndpoint: import("better-call").StrictEndpoint<"/search", {
|
|
3
|
+
method: "GET";
|
|
4
|
+
query: z.ZodObject<{
|
|
5
|
+
q: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
6
|
+
type: z.ZodOptional<z.ZodString>;
|
|
7
|
+
tags: z.ZodOptional<z.ZodString>;
|
|
8
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
relevance: "relevance";
|
|
10
|
+
newest: "newest";
|
|
11
|
+
oldest: "oldest";
|
|
12
|
+
title_asc: "title_asc";
|
|
13
|
+
title_desc: "title_desc";
|
|
14
|
+
}>>;
|
|
15
|
+
fuzzy: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
|
|
16
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
17
|
+
skip: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
18
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
}, {
|
|
21
|
+
results: {
|
|
22
|
+
id: string;
|
|
23
|
+
entityType: string;
|
|
24
|
+
entityId: string;
|
|
25
|
+
title: string;
|
|
26
|
+
url: string;
|
|
27
|
+
image: string | undefined;
|
|
28
|
+
tags: string[];
|
|
29
|
+
score: number;
|
|
30
|
+
highlights: import("../..").SearchHighlight | undefined;
|
|
31
|
+
}[];
|
|
32
|
+
total: number;
|
|
33
|
+
facets: import("../..").SearchFacets;
|
|
34
|
+
didYouMean: string | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/store/endpoints/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,CAAC,EAAE,MAAM,eAAe,CAAC;AAWrE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0D1B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "@86d-app/core";
|
|
2
|
+
export declare const storeSearch: import("better-call").StrictEndpoint<"/search/store-search", {
|
|
3
|
+
method: "GET";
|
|
4
|
+
query: z.ZodObject<{
|
|
5
|
+
q: z.ZodString;
|
|
6
|
+
limit: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
}, {
|
|
9
|
+
results: {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
href: string;
|
|
13
|
+
group: string;
|
|
14
|
+
}[];
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=store-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-search.d.ts","sourceRoot":"","sources":["../../../src/store/endpoints/store-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,CAAC,EAAE,MAAM,eAAe,CAAC;AAGvD,eAAO,MAAM,WAAW;;;;;;;;;;;;;EAqCvB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "@86d-app/core";
|
|
2
|
+
export declare const suggestEndpoint: import("better-call").StrictEndpoint<"/search/suggest", {
|
|
3
|
+
method: "GET";
|
|
4
|
+
query: z.ZodObject<{
|
|
5
|
+
q: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
6
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
}, {
|
|
9
|
+
suggestions: string[];
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=suggest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggest.d.ts","sourceRoot":"","sources":["../../../src/store/endpoints/suggest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,CAAC,EAAE,MAAM,eAAe,CAAC;AAGrE,eAAO,MAAM,eAAe;;;;;;;;EAiB3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@86d-app/search",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Unified search, autocomplete, and search analytics module for 86d commerce platform",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commerce",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"url": "https://github.com/86d-app/86d.git",
|
|
17
17
|
"directory": "modules/search"
|
|
18
18
|
},
|
|
19
|
-
"homepage": "https://
|
|
19
|
+
"homepage": "https://86d.app",
|
|
20
20
|
"type": "module",
|
|
21
21
|
"exports": {
|
|
22
22
|
"./components": "./src/store/components",
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
"typescript": "catalog:",
|
|
44
44
|
"vitest": "catalog:vite"
|
|
45
45
|
}
|
|
46
|
-
}
|
|
46
|
+
}
|