@voltro/plugin-flags 0.87.0 → 0.88.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 +169 -6
- package/THIRD-PARTY-NOTICES.md +6 -1349
- package/dist/config-inspect.js +1 -2
- package/dist/config-port.js +1 -2
- package/dist/config-testing.js +1 -2
- package/dist/config.js +1 -2
- package/dist/define.js +1 -2
- package/dist/errors.js +1 -2
- package/dist/evaluate.js +1 -2
- package/dist/experimentLink.js +1 -2
- package/dist/index.js +1 -2
- package/dist/lifecycle.js +1 -2
- package/dist/rpc.js +1 -2
- package/dist/store.js +1 -2
- package/dist/usage.js +1 -2
- package/dist/web.js +1 -2
- package/package.json +6 -6
package/dist/config-inspect.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as e } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/configInspect.ts
|
|
3
3
|
var t = e.String.pipe(e.check(e.isPattern(/^[A-Za-z][A-Za-z0-9._-]{0,119}$/))), n = e.NullOr(e.Number.pipe(e.check(e.isFinite()))), r = e.Struct({
|
|
4
4
|
key: t,
|
|
5
5
|
valueType: e.String,
|
|
@@ -25,5 +25,4 @@ var t = e.String.pipe(e.check(e.isPattern(/^[A-Za-z][A-Za-z0-9._-]{0,119}$/))),
|
|
|
25
25
|
let t = e.keys.map((e) => e.key);
|
|
26
26
|
return new Set(t).size === t.length && e.keys.every((e) => e.min === null || e.max === null || e.min <= e.max) && JSON.stringify(e.publicKeys) === JSON.stringify(e.keys.filter((e) => e.public).map((e) => e.key)) && (e.backend === "custom" ? e.resolver === "app-owned" && e.version !== "default.v1" : e.resolver !== "app-owned" && (e.resolver === "default" || e.version !== "default.v1"));
|
|
27
27
|
})));
|
|
28
|
-
//#endregion
|
|
29
28
|
export { r as ConfigKeySummarySchema, i as ConfigStatusSchema };
|
package/dist/config-port.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ConfigError as e } from "./errors.js";
|
|
|
2
2
|
import { evaluateVariant as t } from "./evaluate.js";
|
|
3
3
|
import { captureConfigValue as n, captureDefinedConfig as r, configData as i, configError as a, configKey as o } from "./config.js";
|
|
4
4
|
import { Context as s, Effect as c } from "effect";
|
|
5
|
-
|
|
5
|
+
// src/configPort.ts
|
|
6
6
|
var l = ({ entry: e, value: n, subject: r, now: i }) => {
|
|
7
7
|
let o = t(e.key, n, r, i);
|
|
8
8
|
if (!o.enabled || typeof n == "boolean" || !n.variants?.length) return e.flag.defaultValue;
|
|
@@ -121,5 +121,4 @@ var l = ({ entry: e, value: n, subject: r, now: i }) => {
|
|
|
121
121
|
},
|
|
122
122
|
catch: () => a("invalid_value")
|
|
123
123
|
})));
|
|
124
|
-
//#endregion
|
|
125
124
|
export { u as ConfigPort, d as captureConfigService, p as configValue, l as defaultConfigResolver, f as flagConfigService };
|
package/dist/config-testing.js
CHANGED
|
@@ -2,7 +2,7 @@ import { configError as e, defineConfig as t } from "./config.js";
|
|
|
2
2
|
import { ConfigPort as n, defaultConfigResolver as r } from "./config-port.js";
|
|
3
3
|
import { flagsPlugin as i } from "./index.js";
|
|
4
4
|
import { Effect as a, Layer as o, Schema as s } from "effect";
|
|
5
|
-
|
|
5
|
+
// src/configTesting.ts
|
|
6
6
|
var c = {
|
|
7
7
|
app: {
|
|
8
8
|
name: "config-fixture",
|
|
@@ -110,5 +110,4 @@ var c = {
|
|
|
110
110
|
expected: 3
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
//#endregion
|
|
114
113
|
export { l as configCatalogFixture, d as configFakeLayer, c as configFixtureLifecycle, u as configPortFixture, f as configPortSystemFixture, m as configResolverSystemFixture };
|
package/dist/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConfigError as e } from "./errors.js";
|
|
2
2
|
import { defineFlag as t } from "./define.js";
|
|
3
3
|
import { Schema as n } from "effect";
|
|
4
|
-
|
|
4
|
+
// src/config.ts
|
|
5
5
|
var r = (t) => new e({ code: t }), i = /* @__PURE__ */ new WeakSet(), a = (e) => {
|
|
6
6
|
if (!e || typeof e != "object" || !i.has(e)) throw r("invalid_input");
|
|
7
7
|
return e;
|
|
@@ -231,5 +231,4 @@ var r = (t) => new e({ code: t }), i = /* @__PURE__ */ new WeakSet(), a = (e) =>
|
|
|
231
231
|
max: n.max
|
|
232
232
|
});
|
|
233
233
|
}));
|
|
234
|
-
//#endregion
|
|
235
234
|
export { h as captureConfigFlag, l as captureConfigValue, a as captureDefinedConfig, c as configData, r as configError, s as configKey, g as configSummary, m as defineConfig };
|
package/dist/define.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Result as e, Schema as t } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/define.ts
|
|
3
3
|
var n = (e) => typeof e == "object" && !!e && e._voltroTypedFlag === !0, r = (e) => e, i = (n) => {
|
|
4
4
|
let i = (e) => /* @__PURE__ */ Error(`defineFlag(${JSON.stringify(n.key)}): ${e}`);
|
|
5
5
|
if (typeof n.key != "string" || n.key.length === 0) throw Error("defineFlag: a non-empty `key` is required");
|
|
@@ -75,5 +75,4 @@ var n = (e) => typeof e == "object" && !!e && e._voltroTypedFlag === !0, r = (e)
|
|
|
75
75
|
definition: t
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
|
-
//#endregion
|
|
79
78
|
export { i as defineFlag, o as gateOverride, n as isTypedFlag, a as typedValueOf };
|
package/dist/errors.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as e } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/errors.ts
|
|
3
3
|
var t = class extends e.TaggedError()("FlagDisabled", { flag: e.String }) {}, n = class extends e.TaggedError()("FlagToggleRefused", {
|
|
4
4
|
key: e.String,
|
|
5
5
|
reason: e.Literals([
|
|
@@ -14,5 +14,4 @@ var t = class extends e.TaggedError()("FlagDisabled", { flag: e.String }) {}, n
|
|
|
14
14
|
"not_found",
|
|
15
15
|
"unavailable"
|
|
16
16
|
]) }) {};
|
|
17
|
-
//#endregion
|
|
18
17
|
export { r as ConfigError, t as FlagDisabled, n as FlagToggleRefused };
|
package/dist/evaluate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/evaluate.ts
|
|
2
2
|
var e = (e) => typeof e == "boolean" ? { enabled: e } : e, t = (e, t) => {
|
|
3
3
|
let n = 2166136261, r = `${e}:${t}`;
|
|
4
4
|
for (let e = 0; e < r.length; e++) n ^= r.charCodeAt(e), n = Math.imul(n, 16777619);
|
|
@@ -77,5 +77,4 @@ var e = (e) => typeof e == "boolean" ? { enabled: e } : e, t = (e, t) => {
|
|
|
77
77
|
for (let [i, a] of Object.entries(e)) r[i] = f(i, a, t, n);
|
|
78
78
|
return r;
|
|
79
79
|
};
|
|
80
|
-
//#endregion
|
|
81
80
|
export { p as evaluateAll, m as evaluateAllVariants, c as evaluateFlag, s as evaluateSchedule, f as evaluateVariant, d as resolveVariant, e as toDefinition };
|
package/dist/experimentLink.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/experimentLink.ts
|
|
2
2
|
var e = (e, t) => {
|
|
3
3
|
let n = new Map(t.map((e) => [e.name, e])), r = [];
|
|
4
4
|
for (let t of e) {
|
|
@@ -44,5 +44,4 @@ var e = (e, t) => {
|
|
|
44
44
|
let i = r.map((e) => ` · flag "${e.flag}" → experiment "${e.experiment}": ${e.problem}`);
|
|
45
45
|
throw Error(`@voltro/plugin-flags: ${r.length} flag→experiment link problem(s):\n${i.join("\n")}`);
|
|
46
46
|
};
|
|
47
|
-
//#endregion
|
|
48
47
|
export { t as assertFlagExperimentLinks, e as checkFlagExperimentLinks };
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { captureConfigFlag as _e, captureDefinedConfig as ve, configData as ye,
|
|
|
10
10
|
import { ConfigPort as Se, captureConfigService as j, configValue as M, defaultConfigResolver as N, flagConfigService as Ce } from "./config-port.js";
|
|
11
11
|
import { Effect as P, Layer as we, Result as Te } from "effect";
|
|
12
12
|
import { definePlugin as Ee, pluginInstanceName as De } from "@voltro/protocol";
|
|
13
|
-
|
|
13
|
+
// src/index.ts
|
|
14
14
|
var F = (e) => "request" in e && e.request?.subject || "subject" in e && e.subject || {}, I = (e, t) => {
|
|
15
15
|
let n = h.get(t);
|
|
16
16
|
return D(t, "targeted"), n !== void 0 && c(t, n, F(e));
|
|
@@ -411,5 +411,4 @@ var F = (e) => "request" in e && e.request?.subject || "subject" in e && e.subje
|
|
|
411
411
|
} },
|
|
412
412
|
events: []
|
|
413
413
|
});
|
|
414
|
-
//#endregion
|
|
415
414
|
export { e as ConfigError, Se as ConfigPort, C as DEFAULT_FLAG_USAGE_FLUSH_MS, x as FLAG_LIFECYCLE_LIMITS, w as FLAG_USAGE_TABLE, t as FlagDisabled, y as assertFlagExperimentLinks, j as captureConfigService, b as checkFlagExperimentLinks, S as classifyShape, xe as configSummary, H as configSystemContract, M as configValue, pe as dataStoreFlagUsageStore, N as defaultConfigResolver, A as defineConfig, g as defineFlag, f as describeFlags, te as evaluateAll, ne as evaluateAllVariants, c as evaluateFlag, l as evaluateSchedule, u as evaluateVariant, p as featureFlagsTable, m as flagAuditTable, Ce as flagConfigService, fe as flagLifecycleReport, h as flagRegistry, T as flagUsageBuffer, E as flagUsageRowId, me as flagUsageTable, R as flagValue, z as flagVariant, V as flagsPlugin, oe as flipFlagEnabled, de as gateOverride, I as isFlagEnabled, _ as isTypedFlag, se as mergeOverrides, D as recordFlagEvaluation, he as registerFlagUsageRetention, L as requireFlag, d as resolveVariant, ue as setFlagEnabled, ge as startFlagUsageFlush, re as toDefinition, v as typedValueOf, O as utcDay };
|
package/dist/lifecycle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toDefinition as e } from "./evaluate.js";
|
|
2
|
-
|
|
2
|
+
// src/lifecycle.ts
|
|
3
3
|
var t = 864e5, n = (e) => typeof e == "number" ? e : Date.parse(e), r = (t, r) => {
|
|
4
4
|
let i = e(t);
|
|
5
5
|
if (i.enabled === !1) return {
|
|
@@ -78,5 +78,4 @@ var t = 864e5, n = (e) => typeof e == "number" ? e : Date.parse(e), r = (t, r) =
|
|
|
78
78
|
limits: i
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
//#endregion
|
|
82
81
|
export { i as FLAG_LIFECYCLE_LIMITS, r as classifyShape, a as flagLifecycleReport };
|
package/dist/rpc.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConfigError as e } from "./errors.js";
|
|
2
2
|
import { Schema as t } from "effect";
|
|
3
3
|
import { defineQuery as n } from "@voltro/protocol";
|
|
4
|
-
|
|
4
|
+
// src/rpc.ts
|
|
5
5
|
var r = "@voltro/plugin-flags", i = n({
|
|
6
6
|
name: "flags.evaluate",
|
|
7
7
|
input: t.Struct({}),
|
|
@@ -45,5 +45,4 @@ var r = "@voltro/plugin-flags", i = n({
|
|
|
45
45
|
name: "configMineDescriptor"
|
|
46
46
|
}
|
|
47
47
|
}];
|
|
48
|
-
//#endregion
|
|
49
48
|
export { r as BASE_NAME, c as configMineDescriptor, l as configRpcClientImports, i as evaluateDescriptor, o as evaluateVariantsDescriptor, s as flagsRpcClientImports };
|
package/dist/store.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toDefinition as e } from "./evaluate.js";
|
|
2
2
|
import { boolean as t, derivedRowId as n, eq as r, id as i, integer as a, json as o, queryFor as s, table as c, text as l, timestamp as u } from "@voltro/database";
|
|
3
|
-
|
|
3
|
+
// src/store.ts
|
|
4
4
|
var d = "_voltro_feature_flag_audit", f = "_voltro_feature_flags", p = c(f, {
|
|
5
5
|
id: i({ prefix: "flag" }),
|
|
6
6
|
key: l().unique(),
|
|
@@ -186,5 +186,4 @@ var d = "_voltro_feature_flag_audit", f = "_voltro_feature_flags", p = c(f, {
|
|
|
186
186
|
});
|
|
187
187
|
});
|
|
188
188
|
};
|
|
189
|
-
//#endregion
|
|
190
189
|
export { d as FLAGS_AUDIT_TABLE, f as FLAGS_TABLE, g as FlagRegistry, T as dataStoreFlagAuditStore, S as dataStoreFlagStore, b as describeFlags, p as featureFlagsTable, m as flagAuditTable, x as flagValueToRow, y as flipFlagEnabled, h as mergeOverrides, E as persistConfigValue, D as persistFlagToggle, _ as registry, v as setFlagEnabled };
|
package/dist/usage.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { id as e, queryFor as t, registerRetention as n, retentionTtlMsFromEnv as r, table as i, text as a, timestamp as o } from "@voltro/database";
|
|
2
|
-
|
|
2
|
+
// src/usage.ts
|
|
3
3
|
var s = "_voltro_feature_flag_usage", c = i(s, {
|
|
4
4
|
id: e({ prefix: "flagusg" }),
|
|
5
5
|
flag: a(),
|
|
@@ -109,5 +109,4 @@ var s = "_voltro_feature_flag_usage", c = i(s, {
|
|
|
109
109
|
envVar: "VOLTRO_FLAG_USAGE_TTL_HOURS"
|
|
110
110
|
}), i;
|
|
111
111
|
};
|
|
112
|
-
//#endregion
|
|
113
112
|
export { g as DEFAULT_FLAG_USAGE_FLUSH_MS, s as FLAG_USAGE_TABLE, h as dataStoreFlagUsageStore, f as flagUsageBuffer, d as flagUsageRowId, c as flagUsageTable, p as recordFlagEvaluation, v as registerFlagUsageRetention, _ as startFlagUsageFlush, l as utcDay };
|
package/dist/web.js
CHANGED
|
@@ -3,7 +3,7 @@ import { typedValueOf as t } from "./define.js";
|
|
|
3
3
|
import { captureConfigValue as n } from "./config.js";
|
|
4
4
|
import { pluginTag as r } from "@voltro/protocol";
|
|
5
5
|
import { useSubscription as i } from "@voltro/client";
|
|
6
|
-
|
|
6
|
+
// src/web.ts
|
|
7
7
|
var a = (t) => r(e, t), o = (e = "app") => {
|
|
8
8
|
let { data: t } = i(e, a("evaluate"), {});
|
|
9
9
|
return t ?? {};
|
|
@@ -16,5 +16,4 @@ var a = (t) => r(e, t), o = (e = "app") => {
|
|
|
16
16
|
let s = o.flag.decode(a?.[t]);
|
|
17
17
|
return s.ok ? s.value : n(o.flag.defaultValue);
|
|
18
18
|
};
|
|
19
|
-
//#endregion
|
|
20
19
|
export { d as useConfig, s as useFlag, u as useFlagValue, o as useFlags, l as useVariant, c as useVariants };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/plugin-flags",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.88.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",
|
|
@@ -68,13 +68,13 @@
|
|
|
68
68
|
"node": ">=24.0.0"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@voltro/client": "0.
|
|
72
|
-
"@voltro/database": "0.
|
|
73
|
-
"@voltro/logger": "0.
|
|
74
|
-
"@voltro/protocol": "0.
|
|
71
|
+
"@voltro/client": "0.88.0",
|
|
72
|
+
"@voltro/database": "0.88.0",
|
|
73
|
+
"@voltro/logger": "0.88.0",
|
|
74
|
+
"@voltro/protocol": "0.88.0"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"effect": "4.0
|
|
77
|
+
"effect": "4.1.0"
|
|
78
78
|
},
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|