@voltro/plugin-search 0.83.1 → 0.85.0
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/CHANGELOG.md +1191 -0
- package/THIRD-PARTY-NOTICES.md +1 -57
- package/dist/index.d.ts +8 -12
- package/dist/index.js +250 -247
- package/dist/{rpc-CpryHBcM.js → rpc-CggQ77CG.js} +28 -26
- package/dist/rpc.d.ts +32 -35
- package/dist/rpc.js +1 -1
- package/dist/web.js +1 -1
- package/package.json +5 -5
|
@@ -3,25 +3,36 @@ import { defineAction as t } from "@voltro/protocol";
|
|
|
3
3
|
//#region src/errors.ts
|
|
4
4
|
var n = class extends e.TaggedError()("SearchIndexNotFound", { index: e.String }) {}, r = class extends e.TaggedError()("SearchFieldRejected", {
|
|
5
5
|
field: e.String,
|
|
6
|
-
where: e.
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
where: e.Literals([
|
|
7
|
+
"filter",
|
|
8
|
+
"facet",
|
|
9
|
+
"highlight"
|
|
10
|
+
]),
|
|
11
|
+
reason: e.Literals(["not-an-identifier", "not-queryable"])
|
|
12
|
+
}) {}, i = "@voltro/plugin-search", a = e.Union([
|
|
13
|
+
e.String,
|
|
14
|
+
e.Number,
|
|
15
|
+
e.Boolean
|
|
16
|
+
]), o = e.Struct({
|
|
9
17
|
field: e.String,
|
|
10
|
-
op: e.
|
|
11
|
-
|
|
18
|
+
op: e.Literals([
|
|
19
|
+
"eq",
|
|
20
|
+
"neq",
|
|
21
|
+
"gt",
|
|
22
|
+
"gte",
|
|
23
|
+
"lt",
|
|
24
|
+
"lte",
|
|
25
|
+
"in",
|
|
26
|
+
"nin"
|
|
27
|
+
]),
|
|
28
|
+
value: e.Union([a, e.Array(a)])
|
|
12
29
|
}), s = e.Struct({
|
|
13
30
|
fields: e.optional(e.Array(e.String)),
|
|
14
31
|
preTag: e.optional(e.String),
|
|
15
32
|
postTag: e.optional(e.String)
|
|
16
33
|
}), c = e.Struct({
|
|
17
|
-
doc: e.Record(
|
|
18
|
-
|
|
19
|
-
value: e.Unknown
|
|
20
|
-
}),
|
|
21
|
-
highlights: e.optional(e.Record({
|
|
22
|
-
key: e.String,
|
|
23
|
-
value: e.String
|
|
24
|
-
}))
|
|
34
|
+
doc: e.Record(e.String, e.Unknown),
|
|
35
|
+
highlights: e.optional(e.Record(e.String, e.String))
|
|
25
36
|
}), l = t({
|
|
26
37
|
name: "search.query",
|
|
27
38
|
openAccess: "tenant scoping, index registration and field validation are enforced server-side per call; a non-tenant index exposes only what the app's map(row) deliberately indexed",
|
|
@@ -33,23 +44,14 @@ var n = class extends e.TaggedError()("SearchIndexNotFound", { index: e.String }
|
|
|
33
44
|
filters: e.optional(e.Array(o)),
|
|
34
45
|
facets: e.optional(e.Array(e.String)),
|
|
35
46
|
highlight: e.optional(s),
|
|
36
|
-
fuzziness: e.optional(e.Union(e.Number, e.Literal("auto"))),
|
|
37
|
-
engineParams: e.optional(e.Record(
|
|
38
|
-
key: e.String,
|
|
39
|
-
value: e.Unknown
|
|
40
|
-
}))
|
|
47
|
+
fuzziness: e.optional(e.Union([e.Number, e.Literal("auto")])),
|
|
48
|
+
engineParams: e.optional(e.Record(e.String, e.Unknown))
|
|
41
49
|
}),
|
|
42
50
|
output: e.Struct({
|
|
43
51
|
hits: e.Array(c),
|
|
44
|
-
facets: e.Record(
|
|
45
|
-
key: e.String,
|
|
46
|
-
value: e.Record({
|
|
47
|
-
key: e.String,
|
|
48
|
-
value: e.Number
|
|
49
|
-
})
|
|
50
|
-
})
|
|
52
|
+
facets: e.Record(e.String, e.Record(e.String, e.Number))
|
|
51
53
|
}),
|
|
52
|
-
error: e.Union(n, r)
|
|
54
|
+
error: e.Union([n, r])
|
|
53
55
|
}), u = [{
|
|
54
56
|
tag: "search.query",
|
|
55
57
|
kind: "action",
|
package/dist/rpc.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ActionProcedureDescriptor } from '@voltro/protocol';
|
|
2
2
|
import { PluginRpcClientDescriptor } from '@voltro/protocol';
|
|
3
3
|
import { Schema } from 'effect';
|
|
4
|
+
import { YieldableError } from 'effect/Cause';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* The plugin's canonical package name — the key an app's `alias` is recorded
|
|
@@ -18,43 +19,43 @@ export declare const queryDescriptor: ActionProcedureDescriptor<"search.query",
|
|
|
18
19
|
/** One of the indexes the app declared. An unregistered name is refused
|
|
19
20
|
* (`SearchIndexNotFound`) — it has no spec, so it has no tenant field to
|
|
20
21
|
* scope by, and answering it would query an unscoped collection. */
|
|
21
|
-
index:
|
|
22
|
-
q:
|
|
23
|
-
limit: Schema.optional<
|
|
24
|
-
offset: Schema.optional<
|
|
22
|
+
readonly index: Schema.String;
|
|
23
|
+
readonly q: Schema.String;
|
|
24
|
+
readonly limit: Schema.optional<Schema.Number>;
|
|
25
|
+
readonly offset: Schema.optional<Schema.Number>;
|
|
25
26
|
/** Clauses ANDed together — equality, range, negation, set membership. */
|
|
26
|
-
filters: Schema.optional<Schema
|
|
27
|
+
readonly filters: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
27
28
|
/** A doc field path. Validated server-side against the index's declared
|
|
28
29
|
* `queryableFields` (or a plain-identifier pattern) before it is spliced
|
|
29
30
|
* into the engine's filter DSL — a mismatch is a typed
|
|
30
31
|
* `SearchFieldRejected`, not a query. */
|
|
31
|
-
field:
|
|
32
|
-
op: Schema.
|
|
33
|
-
value: Schema.Union<[Schema.Union<[
|
|
32
|
+
readonly field: Schema.String;
|
|
33
|
+
readonly op: Schema.Literals<readonly ["eq", "neq", "gt", "gte", "lt", "lte", "in", "nin"]>;
|
|
34
|
+
readonly value: Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>]>;
|
|
34
35
|
}>>>;
|
|
35
36
|
/** Facet-count fields. */
|
|
36
|
-
facets: Schema.optional<Schema
|
|
37
|
+
readonly facets: Schema.optional<Schema.$Array<Schema.String>>;
|
|
37
38
|
/** Matched-term highlighting. */
|
|
38
|
-
highlight: Schema.optional<Schema.Struct<{
|
|
39
|
-
fields: Schema.optional<Schema
|
|
40
|
-
preTag: Schema.optional<
|
|
41
|
-
postTag: Schema.optional<
|
|
39
|
+
readonly highlight: Schema.optional<Schema.Struct<{
|
|
40
|
+
readonly fields: Schema.optional<Schema.$Array<Schema.String>>;
|
|
41
|
+
readonly preTag: Schema.optional<Schema.String>;
|
|
42
|
+
readonly postTag: Schema.optional<Schema.String>;
|
|
42
43
|
}>>;
|
|
43
44
|
/** Typo tolerance — a max edit distance (0 = exact) or `'auto'`. */
|
|
44
|
-
fuzziness: Schema.optional<Schema.Union<[
|
|
45
|
+
readonly fuzziness: Schema.optional<Schema.Union<readonly [Schema.Number, Schema.Literal<"auto">]>>;
|
|
45
46
|
/** Escape hatch — the engine's presentation-only params (paging, ordering,
|
|
46
47
|
* typo tolerance, highlight shaping). Anything that could select a
|
|
47
48
|
* different document set is dropped server-side and logged; express a
|
|
48
49
|
* filter as a `filters[]` clause instead. */
|
|
49
|
-
engineParams: Schema.optional<Schema
|
|
50
|
+
readonly engineParams: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
50
51
|
}>, Schema.Struct<{
|
|
51
|
-
hits: Schema
|
|
52
|
-
doc: Schema
|
|
53
|
-
highlights: Schema.optional<Schema
|
|
52
|
+
readonly hits: Schema.$Array<Schema.Struct<{
|
|
53
|
+
readonly doc: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
54
|
+
readonly highlights: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
54
55
|
}>>;
|
|
55
56
|
/** field → (value → count) for the requested facets. */
|
|
56
|
-
facets: Schema
|
|
57
|
-
}>, Schema.Union<[typeof SearchIndexNotFound, typeof SearchFieldRejected]>>;
|
|
57
|
+
readonly facets: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Number>>;
|
|
58
|
+
}>, Schema.Union<readonly [typeof SearchIndexNotFound, typeof SearchFieldRejected]>>;
|
|
58
59
|
|
|
59
60
|
/**
|
|
60
61
|
* A field name the caller supplied — in `filters[].field`, `facets[]` or
|
|
@@ -72,22 +73,20 @@ export declare const queryDescriptor: ActionProcedureDescriptor<"search.query",
|
|
|
72
73
|
declare class SearchFieldRejected extends SearchFieldRejected_base {
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
declare const SearchFieldRejected_base: Schema.
|
|
76
|
-
readonly
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
reason: Schema.Literal<["not-an-identifier", "not-queryable"]>;
|
|
81
|
-
}>;
|
|
76
|
+
declare const SearchFieldRejected_base: Schema.Class<SearchFieldRejected, Schema.TaggedStruct<"SearchFieldRejected", {
|
|
77
|
+
readonly field: Schema.String;
|
|
78
|
+
readonly where: Schema.Literals<readonly ["filter", "facet", "highlight"]>;
|
|
79
|
+
readonly reason: Schema.Literals<readonly ["not-an-identifier", "not-queryable"]>;
|
|
80
|
+
}>, YieldableError>;
|
|
82
81
|
|
|
83
82
|
export declare const SearchFilterSchema: Schema.Struct<{
|
|
84
83
|
/** A doc field path. Validated server-side against the index's declared
|
|
85
84
|
* `queryableFields` (or a plain-identifier pattern) before it is spliced
|
|
86
85
|
* into the engine's filter DSL — a mismatch is a typed
|
|
87
86
|
* `SearchFieldRejected`, not a query. */
|
|
88
|
-
field:
|
|
89
|
-
op: Schema.
|
|
90
|
-
value: Schema.Union<[Schema.Union<[
|
|
87
|
+
readonly field: Schema.String;
|
|
88
|
+
readonly op: Schema.Literals<readonly ["eq", "neq", "gt", "gte", "lt", "lte", "in", "nin"]>;
|
|
89
|
+
readonly value: Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>]>;
|
|
91
90
|
}>;
|
|
92
91
|
|
|
93
92
|
/**
|
|
@@ -102,11 +101,9 @@ export declare const SearchFilterSchema: Schema.Struct<{
|
|
|
102
101
|
declare class SearchIndexNotFound extends SearchIndexNotFound_base {
|
|
103
102
|
}
|
|
104
103
|
|
|
105
|
-
declare const SearchIndexNotFound_base: Schema.
|
|
106
|
-
readonly
|
|
107
|
-
}
|
|
108
|
-
index: typeof Schema.String;
|
|
109
|
-
}>;
|
|
104
|
+
declare const SearchIndexNotFound_base: Schema.Class<SearchIndexNotFound, Schema.TaggedStruct<"SearchIndexNotFound", {
|
|
105
|
+
readonly index: Schema.String;
|
|
106
|
+
}>, YieldableError>;
|
|
110
107
|
|
|
111
108
|
/** Declared for the codegen (`VoltroPlugin.rpcClientDescriptors`) so each tag is
|
|
112
109
|
* emitted into the generated client group. Kept in lockstep with the exports. */
|
package/dist/rpc.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as e, n as t, r as n, t as r } from "./rpc-
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "./rpc-CggQ77CG.js";
|
|
2
2
|
export { r as BASE_NAME, t as SearchFilterSchema, n as queryDescriptor, e as searchRpcClientImports };
|
package/dist/web.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/plugin-search",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.85.0",
|
|
4
4
|
"description": "Keep an external search index (Typesense / Meilisearch / Algolia) in sync with framework tables via the post-commit ChangeEvent tap, then query it — tenant-scoped, with a backfill path and a useSearch() hook.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"node": ">=24.0.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@voltro/client": "0.
|
|
47
|
-
"@voltro/database": "0.
|
|
48
|
-
"@voltro/protocol": "0.
|
|
46
|
+
"@voltro/client": "0.85.0",
|
|
47
|
+
"@voltro/database": "0.85.0",
|
|
48
|
+
"@voltro/protocol": "0.85.0"
|
|
49
49
|
},
|
|
50
50
|
"optionalDependencies": {
|
|
51
51
|
"algoliasearch": "^5.59.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"typesense": "^3.0.6"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"effect": "
|
|
56
|
+
"effect": "4.0.1"
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|