@voltro/plugin-flags 0.54.0 → 0.56.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/dist/rpc.d.ts CHANGED
@@ -2,6 +2,18 @@ import { PluginRpcClientDescriptor } from '@voltro/protocol';
2
2
  import { QueryProcedureDescriptor } 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-flags";
16
+
5
17
  export declare const evaluateDescriptor: QueryProcedureDescriptor<"flags.evaluate", Schema.Struct<{}>, Schema.Record$<typeof Schema.String, typeof Schema.Boolean>, typeof Schema.Never>;
6
18
 
7
19
  export declare const evaluateVariantsDescriptor: QueryProcedureDescriptor<"flags.variants", Schema.Struct<{}>, Schema.Record$<typeof Schema.String, Schema.Struct<{
package/dist/rpc.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Schema as e } from "effect";
2
2
  import { defineQuery as t } from "@voltro/protocol";
3
3
  //#region src/rpc.ts
4
- var n = t({
4
+ var n = "@voltro/plugin-flags", r = t({
5
5
  name: "flags.evaluate",
6
6
  input: e.Struct({}),
7
7
  output: e.Record({
@@ -9,19 +9,19 @@ var n = t({
9
9
  value: e.Boolean
10
10
  }),
11
11
  openAccess: "per-caller flag evaluation: returns only the values computed for the calling subject; every session (incl. anonymous) evaluates its own flags"
12
- }), r = e.Struct({
12
+ }), i = e.Struct({
13
13
  name: e.String,
14
14
  value: e.Unknown,
15
15
  enabled: e.Boolean
16
- }), i = t({
16
+ }), a = t({
17
17
  name: "flags.variants",
18
18
  input: e.Struct({}),
19
19
  output: e.Record({
20
20
  key: e.String,
21
- value: r
21
+ value: i
22
22
  }),
23
23
  openAccess: "per-caller variant resolution: returns only the variants served to the calling subject; every session (incl. anonymous) evaluates its own flags"
24
- }), a = [{
24
+ }), o = [{
25
25
  tag: "flags.evaluate",
26
26
  kind: "query",
27
27
  import: {
@@ -37,4 +37,4 @@ var n = t({
37
37
  }
38
38
  }];
39
39
  //#endregion
40
- export { n as evaluateDescriptor, i as evaluateVariantsDescriptor, a as flagsRpcClientImports };
40
+ export { n as BASE_NAME, r as evaluateDescriptor, a as evaluateVariantsDescriptor, o as flagsRpcClientImports };
package/dist/web.js CHANGED
@@ -1,12 +1,14 @@
1
- import { i as e } from "./define-D9Eet7wA.js";
2
- import { useSubscription as t } from "@voltro/client";
1
+ import { BASE_NAME as e } from "./rpc.js";
2
+ import { i as t } from "./define-D9Eet7wA.js";
3
+ import { pluginTag as n } from "@voltro/protocol";
4
+ import { useSubscription as r } from "@voltro/client";
3
5
  //#region src/web.ts
4
- var n = (e = "app") => {
5
- let { data: n } = t(e, "flags.evaluate", {});
6
- return n ?? {};
7
- }, r = (e, t = "app") => n(t)[e] === !0, i = (e = "app") => {
8
- let { data: n } = t(e, "flags.variants", {});
9
- return n ?? {};
10
- }, a = (e, t = "app") => i(t)[e], o = (t, n = "app") => e(t, i(n)[t.key]);
6
+ var i = (t) => n(e, t), a = (e = "app") => {
7
+ let { data: t } = r(e, i("evaluate"), {});
8
+ return t ?? {};
9
+ }, o = (e, t = "app") => a(t)[e] === !0, s = (e = "app") => {
10
+ let { data: t } = r(e, i("variants"), {});
11
+ return t ?? {};
12
+ }, c = (e, t = "app") => s(t)[e], l = (e, n = "app") => t(e, s(n)[e.key]);
11
13
  //#endregion
12
- export { r as useFlag, o as useFlagValue, n as useFlags, a as useVariant, i as useVariants };
14
+ export { o as useFlag, l as useFlagValue, a as useFlags, c as useVariant, s as useVariants };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltro/plugin-flags",
3
- "version": "0.54.0",
3
+ "version": "0.56.0",
4
4
  "description": "Feature flags — per-subject / per-tenant targeting, deterministic % rollouts, kill-switch. Gate mutations/queries/actions declaratively or guard in-handler; evaluate flags client-side for UI gating. Config-as-code (memory) or runtime-toggleable (postgres).",
5
5
  "keywords": [
6
6
  "voltro",
@@ -48,10 +48,10 @@
48
48
  "node": ">=24.0.0"
49
49
  },
50
50
  "dependencies": {
51
- "@voltro/client": "0.54.0",
52
- "@voltro/database": "0.54.0",
53
- "@voltro/logger": "0.54.0",
54
- "@voltro/protocol": "0.54.0"
51
+ "@voltro/client": "0.56.0",
52
+ "@voltro/database": "0.56.0",
53
+ "@voltro/logger": "0.56.0",
54
+ "@voltro/protocol": "0.56.0"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "effect": "^3.22.0"