@voltro/plugin-search 0.54.0 → 0.55.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.
@@ -5,15 +5,15 @@ var n = class extends e.TaggedError()("SearchIndexNotFound", { index: e.String }
5
5
  field: e.String,
6
6
  where: e.Literal("filter", "facet", "highlight"),
7
7
  reason: e.Literal("not-an-identifier", "not-queryable")
8
- }) {}, i = e.Union(e.String, e.Number, e.Boolean), a = e.Struct({
8
+ }) {}, i = "@voltro/plugin-search", a = e.Union(e.String, e.Number, e.Boolean), o = e.Struct({
9
9
  field: e.String,
10
10
  op: e.Literal("eq", "neq", "gt", "gte", "lt", "lte", "in", "nin"),
11
- value: e.Union(i, e.Array(i))
12
- }), o = e.Struct({
11
+ value: e.Union(a, e.Array(a))
12
+ }), s = e.Struct({
13
13
  fields: e.optional(e.Array(e.String)),
14
14
  preTag: e.optional(e.String),
15
15
  postTag: e.optional(e.String)
16
- }), s = e.Struct({
16
+ }), c = e.Struct({
17
17
  doc: e.Record({
18
18
  key: e.String,
19
19
  value: e.Unknown
@@ -22,7 +22,7 @@ var n = class extends e.TaggedError()("SearchIndexNotFound", { index: e.String }
22
22
  key: e.String,
23
23
  value: e.String
24
24
  }))
25
- }), c = t({
25
+ }), l = t({
26
26
  name: "search.query",
27
27
  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",
28
28
  input: e.Struct({
@@ -30,9 +30,9 @@ var n = class extends e.TaggedError()("SearchIndexNotFound", { index: e.String }
30
30
  q: e.String,
31
31
  limit: e.optional(e.Number),
32
32
  offset: e.optional(e.Number),
33
- filters: e.optional(e.Array(a)),
33
+ filters: e.optional(e.Array(o)),
34
34
  facets: e.optional(e.Array(e.String)),
35
- highlight: e.optional(o),
35
+ highlight: e.optional(s),
36
36
  fuzziness: e.optional(e.Union(e.Number, e.Literal("auto"))),
37
37
  engineParams: e.optional(e.Record({
38
38
  key: e.String,
@@ -40,7 +40,7 @@ var n = class extends e.TaggedError()("SearchIndexNotFound", { index: e.String }
40
40
  }))
41
41
  }),
42
42
  output: e.Struct({
43
- hits: e.Array(s),
43
+ hits: e.Array(c),
44
44
  facets: e.Record({
45
45
  key: e.String,
46
46
  value: e.Record({
@@ -50,7 +50,7 @@ var n = class extends e.TaggedError()("SearchIndexNotFound", { index: e.String }
50
50
  })
51
51
  }),
52
52
  error: e.Union(n, r)
53
- }), l = [{
53
+ }), u = [{
54
54
  tag: "search.query",
55
55
  kind: "action",
56
56
  import: {
@@ -59,4 +59,4 @@ var n = class extends e.TaggedError()("SearchIndexNotFound", { index: e.String }
59
59
  }
60
60
  }];
61
61
  //#endregion
62
- export { n as a, r as i, c as n, l as r, a as t };
62
+ export { r as a, u as i, o as n, n as o, l as r, i as t };
package/dist/rpc.d.ts CHANGED
@@ -2,6 +2,18 @@ import { ActionProcedureDescriptor } from '@voltro/protocol';
2
2
  import { PluginRpcClientDescriptor } from '@voltro/protocol';
3
3
  import { Schema } from 'effect';
4
4
 
5
+ /**
6
+ * The plugin's canonical package name — the key an app's `alias` is recorded
7
+ * under, and what `./web`'s hooks resolve their tags through.
8
+ *
9
+ * It lives in this BROWSER-SAFE module rather than in `index.ts` because both
10
+ * halves need it and only one of them may reach the server graph: `index.ts`
11
+ * passes it to `pluginInstanceName` / `baseName`, and `web.ts` passes it to
12
+ * `pluginTag`. A second copy in `web.ts` would be a second definition of the
13
+ * plugin's identity with nothing comparing them.
14
+ */
15
+ export declare const BASE_NAME = "@voltro/plugin-search";
16
+
5
17
  export declare const queryDescriptor: ActionProcedureDescriptor<"search.query", Schema.Struct<{
6
18
  /** One of the indexes the app declared. An unregistered name is refused
7
19
  * (`SearchIndexNotFound`) — it has no spec, so it has no tenant field to
package/dist/rpc.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "./rpc-DaYt-dP6.js";
2
- export { n as SearchFilterSchema, e as queryDescriptor, t as searchRpcClientImports };
1
+ import { i as e, n as t, r as n, t as r } from "./rpc-CpryHBcM.js";
2
+ export { r as BASE_NAME, t as SearchFilterSchema, n as queryDescriptor, e as searchRpcClientImports };
package/dist/web.js CHANGED
@@ -1,18 +1,20 @@
1
- import { useAction as e } from "@voltro/client";
1
+ import { t as e } from "./rpc-CpryHBcM.js";
2
+ import { pluginTag as t } from "@voltro/protocol";
3
+ import { useAction as n } from "@voltro/client";
2
4
  //#region src/web.ts
3
- var t = (t, n = "app") => {
4
- let r = e(n, "search.query"), i = r.lastResult;
5
+ var r = (n) => t(e, n), i = (e, t = "app") => {
6
+ let i = n(t, r("query")), a = i.lastResult;
5
7
  return {
6
- run: (e, n) => r.run({
7
- index: t,
8
- q: e,
8
+ run: (t, n) => i.run({
9
+ index: e,
10
+ q: t,
9
11
  ...n ?? {}
10
12
  }),
11
- results: (i?.hits ?? []).map((e) => e.doc),
12
- facets: i?.facets ?? {},
13
- pending: r.pending,
14
- error: r.error
13
+ results: (a?.hits ?? []).map((e) => e.doc),
14
+ facets: a?.facets ?? {},
15
+ pending: i.pending,
16
+ error: i.error
15
17
  };
16
18
  };
17
19
  //#endregion
18
- export { t as useSearch };
20
+ export { i as useSearch };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltro/plugin-search",
3
- "version": "0.54.0",
3
+ "version": "0.55.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.54.0",
47
- "@voltro/database": "0.54.0",
48
- "@voltro/protocol": "0.54.0"
46
+ "@voltro/client": "0.55.0",
47
+ "@voltro/database": "0.55.0",
48
+ "@voltro/protocol": "0.55.0"
49
49
  },
50
50
  "optionalDependencies": {
51
51
  "algoliasearch": "^5.56.0",