@voltro/plugin-flags 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.
@@ -5,66 +5,10 @@ property of its respective copyright holders and is used under the terms of
5
5
  its license. This file is provided for attribution; it grants no rights in
6
6
  @voltro/plugin-flags itself, which is proprietary (see LICENSE).
7
7
 
8
- Generated from the resolved runtime dependency closure (13 packages).
8
+ Generated from the resolved runtime dependency closure (11 packages).
9
9
 
10
10
  ---
11
11
 
12
- ## @effect/experimental@0.61.1
13
-
14
- License: MIT
15
-
16
- ```
17
- MIT License
18
-
19
- Copyright (c) 2023-present The Contributors
20
-
21
- Permission is hereby granted, free of charge, to any person obtaining a copy
22
- of this software and associated documentation files (the "Software"), to deal
23
- in the Software without restriction, including without limitation the rights
24
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25
- copies of the Software, and to permit persons to whom the Software is
26
- furnished to do so, subject to the following conditions:
27
-
28
- The above copyright notice and this permission notice shall be included in all
29
- copies or substantial portions of the Software.
30
-
31
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37
- SOFTWARE.
38
- ```
39
-
40
- ## @effect/sql@0.52.1
41
-
42
- License: MIT
43
-
44
- ```
45
- MIT License
46
-
47
- Copyright (c) 2023-present The Contributors
48
-
49
- Permission is hereby granted, free of charge, to any person obtaining a copy
50
- of this software and associated documentation files (the "Software"), to deal
51
- in the Software without restriction, including without limitation the rights
52
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
53
- copies of the Software, and to permit persons to whom the Software is
54
- furnished to do so, subject to the following conditions:
55
-
56
- The above copyright notice and this permission notice shall be included in all
57
- copies or substantial portions of the Software.
58
-
59
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
61
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
62
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
64
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
65
- SOFTWARE.
66
- ```
67
-
68
12
  ## @tanstack/devtools-event-client@0.4.4
69
13
 
70
14
  License: MIT
@@ -1,4 +1,4 @@
1
- import { Either as e, Schema as t } from "effect";
1
+ import { Result as e, Schema as t } from "effect";
2
2
  //#region 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}`);
@@ -13,17 +13,17 @@ var n = (e) => typeof e == "object" && !!e && e._voltroTypedFlag === !0, r = (e)
13
13
  if (n.offVariant !== void 0 && !o.has(n.offVariant)) throw i(`offVariant ${JSON.stringify(n.offVariant)} is not one of the declared variants`);
14
14
  if (n.rollout !== void 0 && !(Number.isFinite(n.rollout) && n.rollout >= 0 && n.rollout <= 100)) throw i("rollout must be a number in 0..100");
15
15
  if (n.experiment !== void 0 && (typeof n.experiment != "string" || n.experiment.length === 0)) throw i("experiment, when present, must be a non-empty experiment name");
16
- let s = t.decodeUnknownEither(n.value, {
16
+ let s = t.decodeUnknownResult(n.value, {
17
17
  errors: "all",
18
18
  onExcessProperty: "ignore"
19
19
  }), c = (t) => {
20
20
  let n = s(t);
21
- return e.isRight(n) ? {
21
+ return e.isSuccess(n) ? {
22
22
  ok: !0,
23
- value: n.right
23
+ value: n.success
24
24
  } : {
25
25
  ok: !1,
26
- reason: n.left.message
26
+ reason: n.failure.message
27
27
  };
28
28
  }, l = c(n.default);
29
29
  if (!l.ok) throw i(`\`default\` does not satisfy the value Schema: ${l.reason}`);
package/dist/errors.d.ts CHANGED
@@ -1,14 +1,13 @@
1
1
  import { Schema } from 'effect';
2
+ import { YieldableError } from 'effect/Cause';
2
3
 
3
4
  /** Raised when a flag-gated call hits a disabled flag. Merged into every
4
5
  * procedure's wire-error union so the client decodes it typed. */
5
6
  export declare class FlagDisabled extends FlagDisabled_base {
6
7
  }
7
8
 
8
- declare const FlagDisabled_base: Schema.TaggedErrorClass<FlagDisabled, "FlagDisabled", {
9
- readonly _tag: Schema.tag<"FlagDisabled">;
10
- } & {
11
- flag: typeof Schema.String;
12
- }>;
9
+ declare const FlagDisabled_base: Schema.Class<FlagDisabled, Schema.TaggedStruct<"FlagDisabled", {
10
+ readonly flag: Schema.String;
11
+ }>, YieldableError>;
13
12
 
14
13
  export { }
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import { FieldDefinitions } from '@voltro/database';
5
5
  import { Schema } from 'effect';
6
6
  import { Table } from '@voltro/database';
7
7
  import { VoltroPlugin } from '@voltro/protocol';
8
+ import { YieldableError } from 'effect/Cause';
8
9
 
9
10
  /** `TypedFlag` with the value type erased — what the plugin and the registry
10
11
  * hold. Sound because `TypedFlag` is covariant in `A` (see the annotation). */
@@ -78,9 +79,9 @@ export declare const DEFAULT_FLAG_USAGE_FLUSH_MS = 300000;
78
79
  * a duplicate variant name, an `offVariant` naming no variant, a non-positive
79
80
  * weight, a rollout outside 0..100.
80
81
  */
81
- export declare const defineFlag: <S extends Schema.Schema.AnyNoContext>(spec: DefineFlagSpec<S>) => TypedFlag<Schema.Schema.Type<S>>;
82
+ export declare const defineFlag: <S extends Schema.Top>(spec: DefineFlagSpec<S>) => TypedFlag<Schema.Schema.Type<S>>;
82
83
 
83
- export declare interface DefineFlagSpec<S extends Schema.Schema.AnyNoContext> {
84
+ export declare interface DefineFlagSpec<S extends Schema.Top> {
84
85
  /** The flag key — `dotted.camelCase`, matching the `flags: { … }` record. */
85
86
  readonly key: string;
86
87
  /** The value Schema. Everything else in this spec is checked against it. */
@@ -254,11 +255,9 @@ export declare interface FlagDefinition {
254
255
  export declare class FlagDisabled extends FlagDisabled_base {
255
256
  }
256
257
 
257
- declare const FlagDisabled_base: Schema.TaggedErrorClass<FlagDisabled, "FlagDisabled", {
258
- readonly _tag: Schema.tag<"FlagDisabled">;
259
- } & {
260
- flag: typeof Schema.String;
261
- }>;
258
+ declare const FlagDisabled_base: Schema.Class<FlagDisabled, Schema.TaggedStruct<"FlagDisabled", {
259
+ readonly flag: Schema.String;
260
+ }>, YieldableError>;
262
261
 
263
262
  export declare interface FlagExperimentLinkProblem {
264
263
  readonly flag: string;