viell-effect-schema-http 0.4.0 → 0.6.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.
@@ -1 +1 @@
1
- {"version":3,"file":"shape.js","sourceRoot":"","sources":["../../../src/http/internal/shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAiCtC,MAAM,cAAc,GAAG,CAAC,GAAkB,EAAW,EAAE,CACrD,GAAG,CAAC,IAAI,KAAK,WAAW;IACxB,GAAG,CAAC,IAAI,KAAK,MAAM;IACnB,CAAC,GAAG,CAAC,IAAI,KAAK,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,cAAc,GAAG,CAAC,IAAmB,EAAW,EAAE;IACtD,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;IACvE,OAAO,CACL,CAAC,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC;QAC9B,CAAC,cAAc,CAAC,OAAO,CAAC;QACxB,IAAI,EAAE,cAAc,CAAC,IAAI,KAAK,gBAAgB;QAC9C,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,CAClD,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,GAAsB,EAAW,EAAE;IACtD,MAAM,MAAM,GAAG,GAAG,CAAC,kBAAkB,CAAC,GAAG,CACvC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CACj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J,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAC/D,OAAO,EAAE,CACV,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;AACtD,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viell-effect-schema-http",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Consumer-owned HTTP contracts composed with Effect",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -8,6 +8,7 @@ import {
8
8
  import type * as Body from "./Body.js";
9
9
  import * as Fields from "./internal/fields.js";
10
10
  import * as Inputs from "./internal/input.js";
11
+ import * as Groups from "./internal/group.js";
11
12
  import * as Shapes from "./internal/shape.js";
12
13
  import * as Transport from "./Transport.js";
13
14
  import * as UrlEncoding from "./UrlEncoding.js";
@@ -182,7 +183,9 @@ export type Shape = Shapes.Shape;
182
183
  * @remarks
183
184
  * This is a low-level extension type. A field a union would lose is not lost if another schema in
184
185
  * the group took it, and `settled` is never an answer to that: a schema can allow a name it did not
185
- * take.
186
+ * take. Optional `certificates` records actual claims per applied binding, allowing a union to
187
+ * replace its claim without removing another binding's evidence. Custom drafts with only `fields`
188
+ * and `settled` keep the earlier behavior and skip union recovery.
186
189
  */
187
190
  export type Taken = Shapes.Taken;
188
191
 
@@ -557,7 +560,7 @@ const editQuery =
557
560
  * With a {@link headers} schema bound, in either order, the name has to be one a schema allows, and
558
561
  * the value is a default that goes through the schema. Setting a name the schema always writes,
559
562
  * after that schema, is an {@link InvalidRequest}, because the value could never reach the client.
560
- * A direct struct's constructor-filled optional field is also refused when this preparation
563
+ * A direct struct's schema-supplied optional field is also refused when this preparation
561
564
  * supplies and encodes it after the caller leaves it out, as {@link headers} describes.
562
565
  *
563
566
  * In the object form each key replaces its name as above, in key order, and other names stay. A key
@@ -606,7 +609,7 @@ export const appendHeader = (name: string, value: FieldValue) =>
606
609
  * Names compare without case. Value functions are never evaluated to compare with `value`. Removing
607
610
  * a name a {@link headers} schema always writes, after that schema, is an {@link InvalidRequest},
608
611
  * because the schema puts the value back. Removing an optional field clears its default.
609
- * A constructor-filled optional field can also put it back and be refused, as {@link headers}
612
+ * A schema-supplied optional field can also put it back and be refused, as {@link headers}
610
613
  * describes.
611
614
  *
612
615
  * Without a value, this also stops the library's automatic value for that name: an operation's
@@ -644,7 +647,7 @@ export const removeHeader = (name: string, value?: string) =>
644
647
  * With a {@link query} schema bound, in either order, the name has to be one a schema allows, and
645
648
  * the value is a default that goes through the schema. Setting a name the schema always writes,
646
649
  * after that schema, is an {@link InvalidRequest}, because the value could never reach the client.
647
- * A direct struct's constructor-filled optional field is also refused when this preparation
650
+ * A direct struct's schema-supplied optional field is also refused when this preparation
648
651
  * supplies and encodes it after the caller leaves it out, as {@link query} describes.
649
652
  *
650
653
  * The object form takes {@link QueryFields}. Each key replaces its name as above, in key order, and
@@ -693,7 +696,7 @@ export const appendQuery = (name: string, value: FieldValue<string | null>) =>
693
696
  * functions are not evaluated for comparison. Removing a name a {@link query} schema always writes,
694
697
  * after that schema, is an {@link InvalidRequest}, because the schema puts the value back. Removing
695
698
  * an optional field clears its default.
696
- * A constructor-filled optional field can also put it back and be refused, as {@link query}
699
+ * A schema-supplied optional field can also put it back and be refused, as {@link query}
697
700
  * describes.
698
701
  */
699
702
  export const removeQuery = (name: string, value?: string | null) =>
@@ -772,10 +775,10 @@ const lostFields = (
772
775
  message: `The ${group} group cannot be built against its schema: with the rest of the group, these fields would be lost: ${listNames(names)}.`,
773
776
  });
774
777
 
775
- /** Names only: the caller's omitted fields were actually supplied and written by construction. */
776
- const constructorConflict = (group: string, names: ReadonlyArray<string>) =>
778
+ /** Names only: schema preparation supplied the caller's omitted fields and wrote them. */
779
+ const preparationConflict = (group: string, names: ReadonlyArray<string>) =>
777
780
  new InvalidRequest({
778
- message: `A constructor supplied these omitted ${group} fields and their schema wrote them, so a later raw edit would be lost: ${listNames(names)}. Supply the value as input, set it with Request.mapInput, or use Request.unbind("${group}") first.`,
781
+ message: `Schema preparation supplied and wrote these omitted ${group} fields, so a later raw edit would be lost: ${listNames(names)}. Supply the value as input, set it with Request.mapInput, or use Request.unbind("${group}") first.`,
779
782
  });
780
783
 
781
784
  /** Fields a body's encoder supplies unless the request says otherwise. */
@@ -818,11 +821,14 @@ type GroupInput<K extends "query" | "headers", A> =
818
821
  * `undefined` still has to fit `Input`. Stacked schemas allow omission only when each one does;
819
822
  * a raw default does not make a required group optional. The invocation object is still required.
820
823
  *
821
- * In a direct struct, a constructor default can supply an omitted optional field. A raw edit
822
- * after that binding is an {@link InvalidRequest} when this preparation successfully constructs
823
- * the group and encodes a non-`undefined` value for that field. This reads the preparation's result;
824
- * it never reruns a default. Construction proof is unavailable after decoder fallback, for group
825
- * transformations, classes or unions, or for an accessor or inherited input property.
824
+ * In a direct struct, schema preparation can supply an omitted optional field. A raw edit after
825
+ * that binding is an {@link InvalidRequest} when successful preparation writes an own enumerable
826
+ * data property with a non-`undefined` value under that name in a non-iterable record. This reads
827
+ * the preparation's result without repeating schema work. A transformed group also qualifies when
828
+ * its decoded and encoded endpoints are closed structs and the ordinary or null-prototype caller
829
+ * object has no own keys of any kind and none of either endpoint's names exists on its prototype
830
+ * chain. Only an edited, declared encoded string name is checked. Nonempty transformed groups,
831
+ * classes, unions and iterable output remain outside this proof.
826
832
  *
827
833
  * The input is an {@link Input} of the schema. Encoding produces ordered header lines. The schema
828
834
  * states the shape of the group, whatever the order of the calls: once any schema is bound, every
@@ -841,6 +847,13 @@ type GroupInput<K extends "query" | "headers", A> =
841
847
  * one of them takes stays with it, whatever a union beside it leaves out. Use {@link unbind} to
842
848
  * start again.
843
849
  *
850
+ * If a bare anyOf union would otherwise refuse uncovered root fields, it can retry the whole union
851
+ * with each member first, using the complete original input. Recovery needs actual other-binding
852
+ * claims for remaining losses and preserves every previously certified name. Parent metadata,
853
+ * transformed, open or iterable members, nested losses and joint backtracking are excluded. Existing
854
+ * successful reads do not retry. Recovery adds at most one whole-union read per other member; those
855
+ * attempts can repeat schema effects and can fail.
856
+ *
844
857
  * A field the schema produces wins over an automatic `Accept`, `Content-Type` or `Content-Length`,
845
858
  * whether the schema is bound before or after the body, and so does a default. An optional field
846
859
  * left out with no default declares nothing, so the automatic value still applies.
@@ -855,6 +868,7 @@ export const headers = <
855
868
  contract: S,
856
869
  ) => {
857
870
  const read = Inputs.reader(contract, Schema.encodeEffect(contract));
871
+ const recover = Groups.recovery(contract);
858
872
  const { shape, settle, taken, candidates, filled } = Shapes.bind(
859
873
  contract,
860
874
  foldHeader,
@@ -865,8 +879,9 @@ export const headers = <
865
879
  I & GroupInput<"headers", Input<S>>,
866
880
  E | Schema.SchemaError | InvalidRequest,
867
881
  R | S["EncodingServices"] | S["DecodingServices"]
868
- > =>
869
- construct(
882
+ > => {
883
+ const token = {};
884
+ return construct(
870
885
  {
871
886
  ...self.declaration,
872
887
  headerShapes: [...self.declaration.headerShapes, shape],
@@ -881,26 +896,39 @@ export const headers = <
881
896
  input.headers === undefined ? {} : input.headers
882
897
  ) as Input<S>;
883
898
  const edited = candidates(value, draft.editedFields.get(shape));
884
- const { output, lost: lostFromInput, constructed } = yield* read(value);
885
- const conflicts = filled(edited, constructed, output);
899
+ let { output, lost: lostFromInput } = yield* read(value);
900
+ let conflicts = filled(edited, output);
886
901
  const own = draft.takenHeaders && taken(value, output, lostFromInput);
887
- const prepared = yield* self.prepare(
902
+ let prepared = yield* self.prepare(
888
903
  input,
889
904
  own === undefined
890
905
  ? draft
891
906
  : {
892
907
  ...draft,
893
- takenHeaders: Shapes.taking(draft.takenHeaders, own),
908
+ takenHeaders: Shapes.taking(draft.takenHeaders, own, token),
894
909
  },
895
910
  );
896
- if (lostFromInput.length > 0)
911
+ if (lostFromInput.length > 0) {
912
+ const recovered = yield* recover(
913
+ value,
914
+ { output, lost: lostFromInput },
915
+ prepared.takenHeaders,
916
+ token,
917
+ taken,
918
+ );
919
+ if (recovered !== undefined) {
920
+ ({ output, lost: lostFromInput } = recovered.reading);
921
+ conflicts = filled(edited, output);
922
+ prepared = { ...prepared, takenHeaders: recovered.taken };
923
+ }
897
924
  yield* Inputs.refuseLost(
898
925
  contract,
899
926
  lostFromInput,
900
927
  prepared.takenHeaders?.fields,
901
928
  );
929
+ }
902
930
  if (conflicts.length > 0)
903
- return yield* constructorConflict("headers", conflicts);
931
+ return yield* preparationConflict("headers", conflicts);
904
932
  const names = Shapes.written(output, foldHeader);
905
933
  const elsewhere = Shapes.others(
906
934
  shape,
@@ -947,6 +975,7 @@ export const headers = <
947
975
  };
948
976
  }),
949
977
  );
978
+ };
950
979
  };
951
980
 
952
981
  /**
@@ -970,11 +999,14 @@ export const headers = <
970
999
  * `undefined` still has to fit `Input`. Stacked schemas allow omission only when each one does;
971
1000
  * a raw default does not make a required group optional. The invocation object is still required.
972
1001
  *
973
- * In a direct struct, a constructor default can supply an omitted optional field. A raw edit
974
- * after that binding is an {@link InvalidRequest} when this preparation successfully constructs
975
- * the group and encodes a non-`undefined` value for that field. This reads the preparation's result;
976
- * it never reruns a default. Construction proof is unavailable after decoder fallback, for group
977
- * transformations, classes or unions, or for an accessor or inherited input property.
1002
+ * In a direct struct, schema preparation can supply an omitted optional field. A raw edit after
1003
+ * that binding is an {@link InvalidRequest} when successful preparation writes an own enumerable
1004
+ * data property with a non-`undefined` value under that name in a non-iterable record. This reads
1005
+ * the preparation's result without repeating schema work. A transformed group also qualifies when
1006
+ * its decoded and encoded endpoints are closed structs and the ordinary or null-prototype caller
1007
+ * object has no own keys of any kind and none of either endpoint's names exists on its prototype
1008
+ * chain. Only an edited, declared encoded string name is checked. Nonempty transformed groups,
1009
+ * classes, unions and iterable output remain outside this proof.
978
1010
  *
979
1011
  * The input is an {@link Input} of the schema. The schema encodes to `UrlEncoding.QueryInput` and
980
1012
  * states the shape of the group, whatever the order of the calls: once any schema is bound, every
@@ -998,6 +1030,13 @@ export const headers = <
998
1030
  * Query schemas stack: a second one adds its fields, and together they state the shape. A field one
999
1031
  * of them takes stays with it, whatever a union beside it leaves out. Use {@link unbind} to start
1000
1032
  * again, and {@link mapInput} to supply a required field's value.
1033
+ *
1034
+ * If a bare anyOf union would otherwise refuse uncovered root fields, it can retry the whole union
1035
+ * with each member first, using the complete original input. Recovery needs actual other-binding
1036
+ * claims for remaining losses and preserves every previously certified name. Parent metadata,
1037
+ * transformed, open or iterable members, nested losses and joint backtracking are excluded. Existing
1038
+ * successful reads do not retry. Recovery adds at most one whole-union read per other member; those
1039
+ * attempts can repeat schema effects and can fail.
1001
1040
  */
1002
1041
  export const query = <
1003
1042
  S extends Schema.Top &
@@ -1006,6 +1045,7 @@ export const query = <
1006
1045
  contract: S,
1007
1046
  ) => {
1008
1047
  const read = Inputs.reader(contract, Schema.encodeEffect(contract));
1048
+ const recover = Groups.recovery(contract);
1009
1049
  const { shape, settle, taken, candidates, filled } = Shapes.bind(
1010
1050
  contract,
1011
1051
  foldQuery,
@@ -1016,8 +1056,9 @@ export const query = <
1016
1056
  I & GroupInput<"query", Input<S>>,
1017
1057
  E | Schema.SchemaError | InvalidRequest,
1018
1058
  R | S["EncodingServices"] | S["DecodingServices"]
1019
- > =>
1020
- construct(
1059
+ > => {
1060
+ const token = {};
1061
+ return construct(
1021
1062
  {
1022
1063
  ...self.declaration,
1023
1064
  queryShapes: [...self.declaration.queryShapes, shape],
@@ -1032,26 +1073,39 @@ export const query = <
1032
1073
  input.query === undefined ? {} : input.query
1033
1074
  ) as Input<S>;
1034
1075
  const edited = candidates(value, draft.editedFields.get(shape));
1035
- const { output, lost: lostFromInput, constructed } = yield* read(value);
1036
- const conflicts = filled(edited, constructed, output);
1076
+ let { output, lost: lostFromInput } = yield* read(value);
1077
+ let conflicts = filled(edited, output);
1037
1078
  const own = draft.takenQuery && taken(value, output, lostFromInput);
1038
- const prepared = yield* self.prepare(
1079
+ let prepared = yield* self.prepare(
1039
1080
  input,
1040
1081
  own === undefined
1041
1082
  ? draft
1042
1083
  : {
1043
1084
  ...draft,
1044
- takenQuery: Shapes.taking(draft.takenQuery, own),
1085
+ takenQuery: Shapes.taking(draft.takenQuery, own, token),
1045
1086
  },
1046
1087
  );
1047
- if (lostFromInput.length > 0)
1088
+ if (lostFromInput.length > 0) {
1089
+ const recovered = yield* recover(
1090
+ value,
1091
+ { output, lost: lostFromInput },
1092
+ prepared.takenQuery,
1093
+ token,
1094
+ taken,
1095
+ );
1096
+ if (recovered !== undefined) {
1097
+ ({ output, lost: lostFromInput } = recovered.reading);
1098
+ conflicts = filled(edited, output);
1099
+ prepared = { ...prepared, takenQuery: recovered.taken };
1100
+ }
1048
1101
  yield* Inputs.refuseLost(
1049
1102
  contract,
1050
1103
  lostFromInput,
1051
1104
  prepared.takenQuery?.fields,
1052
1105
  );
1106
+ }
1053
1107
  if (conflicts.length > 0)
1054
- return yield* constructorConflict("query", conflicts);
1108
+ return yield* preparationConflict("query", conflicts);
1055
1109
  const names = Shapes.written(output, foldQuery);
1056
1110
  const elsewhere = Shapes.others(shape, prepared.takenQuery, foldQuery);
1057
1111
  const defaults = prepared.request.urlParams.params
@@ -1077,6 +1131,7 @@ export const query = <
1077
1131
  );
1078
1132
  }),
1079
1133
  );
1134
+ };
1080
1135
  };
1081
1136
 
1082
1137
  /** A renderer: what to add to the path, from the encoded value and the path-value encoder. */
@@ -1526,6 +1581,7 @@ const takenRecord = (shapes: ReadonlyArray<Shape>): Taken | undefined =>
1526
1581
  shapes.length > 1 && shapes.some(({ chooses }) => chooses)
1527
1582
  ? {
1528
1583
  fields: new Set(),
1584
+ certificates: new Map(),
1529
1585
  settled: new Set(
1530
1586
  shapes.flatMap(({ chooses, names }) =>
1531
1587
  chooses ? [] : Array.from(names),
@@ -0,0 +1,60 @@
1
+ import { Effect, type Schema } from "effect";
2
+ import type * as Excess from "./excess.js";
3
+ import * as Inputs from "./input.js";
4
+ import * as Shapes from "./shape.js";
5
+
6
+ /** Retry only an uncovered root loss, keeping the original obligations and all earlier claims. */
7
+ export const recovery = <S extends Schema.Top>(contract: S) => {
8
+ // Building every full permutation costs quadratic space; defer it until recovery is necessary.
9
+ let readers: ReturnType<typeof Inputs.reorderedReaders<S>> | undefined;
10
+ return Effect.fnUntraced(function* (
11
+ input: Inputs.Input<S>,
12
+ original: Inputs.Written<S["Encoded"]>,
13
+ taken: Shapes.Taken | undefined,
14
+ token: object,
15
+ claim: (
16
+ input: unknown,
17
+ output: object,
18
+ lost: ReadonlyArray<Excess.Path>,
19
+ ) => ReadonlySet<PropertyKey>,
20
+ ) {
21
+ if (
22
+ taken?.certificates === undefined ||
23
+ !taken.certificates.has(token) ||
24
+ typeof original.output !== "object" ||
25
+ original.output === null ||
26
+ Symbol.iterator in original.output ||
27
+ original.lost.some((path) => path.length !== 1) ||
28
+ original.lost.every(([name]) => taken.fields.has(name!))
29
+ )
30
+ return undefined;
31
+ const alternatives = (readers ??= Inputs.reorderedReaders(contract));
32
+ const elsewhere = Shapes.certifiedElsewhere(taken, token);
33
+ for (const read of alternatives) {
34
+ // Only typed schema failures permit the next attempt. Defects and interruption propagate.
35
+ const attempt = yield* Effect.result(read(input));
36
+ if (attempt._tag === "Failure") continue;
37
+ const candidate = attempt.success;
38
+ if (
39
+ typeof candidate.output !== "object" ||
40
+ candidate.output === null ||
41
+ Symbol.iterator in candidate.output ||
42
+ candidate.lost.some(
43
+ (path) => path.length !== 1 || !elsewhere.has(path[0]!),
44
+ )
45
+ )
46
+ continue;
47
+ const next = Shapes.retaking(
48
+ taken,
49
+ claim(input, candidate.output, candidate.lost),
50
+ token,
51
+ );
52
+ if (
53
+ next !== undefined &&
54
+ original.lost.every(([name]) => next.fields.has(name!))
55
+ )
56
+ return { reading: candidate, taken: next };
57
+ }
58
+ return undefined;
59
+ });
60
+ };
@@ -1,4 +1,4 @@
1
- import { Effect, Schema, type SchemaAST } from "effect";
1
+ import { Effect, Schema, SchemaAST } from "effect";
2
2
  import * as Excess from "./excess.js";
3
3
 
4
4
  /** What a schema's constructor takes. This is the one place that names the `~`-prefixed key. */
@@ -60,7 +60,7 @@ export type Input<S extends Schema.Top> = EitherSide<
60
60
  * neither fails with the decoded side's error, so existing failures read the same. `options` go to
61
61
  * every parse.
62
62
  */
63
- const toDecodedWithEvidence = <S extends Schema.Top>(
63
+ export const toDecoded = <S extends Schema.Top>(
64
64
  contract: S,
65
65
  options?: SchemaAST.ParseOptions,
66
66
  ) => {
@@ -88,45 +88,17 @@ const toDecodedWithEvidence = <S extends Schema.Top>(
88
88
  : byField(input);
89
89
  return (
90
90
  input: Input<S>,
91
- ): Effect.Effect<
92
- Decoded<S["Type"]>,
93
- Schema.SchemaError,
94
- S["DecodingServices"]
95
- > =>
96
- Effect.catch(
97
- Effect.map(make(input), (value) => ({ value, constructed: true })),
98
- (failure) =>
99
- Effect.mapError(
100
- Effect.map(
101
- Effect.catch(decode(input, options), (encodedFailure) =>
102
- typeof input === "object" && input !== null
103
- ? byMember(input)
104
- : Effect.fail(encodedFailure),
105
- ),
106
- (value) => ({ value, constructed: false }),
107
- ),
108
- () => failure,
91
+ ): Effect.Effect<S["Type"], Schema.SchemaError, S["DecodingServices"]> =>
92
+ Effect.catch(make(input), (failure) =>
93
+ Effect.mapError(
94
+ Effect.catch(decode(input, options), (encodedFailure) =>
95
+ typeof input === "object" && input !== null
96
+ ? byMember(input)
97
+ : Effect.fail(encodedFailure),
109
98
  ),
110
- ) as Effect.Effect<
111
- Decoded<S["Type"]>,
112
- Schema.SchemaError,
113
- S["DecodingServices"]
114
- >;
115
- };
116
-
117
- /** Only the first successful constructor route proves how a group acquired an omitted field. */
118
- interface Decoded<A> {
119
- readonly value: A;
120
- readonly constructed: boolean;
121
- }
122
-
123
- /** Bring either side to the decoded side, without exposing how it was read. */
124
- export const toDecoded = <S extends Schema.Top>(
125
- contract: S,
126
- options?: SchemaAST.ParseOptions,
127
- ) => {
128
- const read = toDecodedWithEvidence(contract, options);
129
- return (input: Input<S>) => Effect.map(read(input), ({ value }) => value);
99
+ () => failure,
100
+ ),
101
+ ) as Effect.Effect<S["Type"], Schema.SchemaError, S["DecodingServices"]>;
130
102
  };
131
103
 
132
104
  /** Read a field or union member, which may be on either side of its own schema. */
@@ -141,8 +113,6 @@ const fromPart = (
141
113
  export interface Written<A> {
142
114
  readonly output: A;
143
115
  readonly lost: ReadonlyArray<Excess.Path>;
144
- /** Own data fields from the successful first direct-struct construction, before encoding. */
145
- readonly constructed: unknown;
146
116
  }
147
117
 
148
118
  /** Takes a decoded value out through a schema, as the options say. */
@@ -183,55 +153,31 @@ export const reader = <S extends Schema.Top, A, R>(
183
153
  contract: S,
184
154
  write: Write<S, A, R>,
185
155
  ) => {
186
- const decoded = toDecodedWithEvidence(contract);
187
- const constructorFields =
188
- contract.ast._tag === "Objects" && contract.ast.encoding === undefined
189
- ? contract.ast.propertySignatures.filter(
190
- ({ type }) => type.context?.constructorDefault !== undefined,
191
- )
192
- : [];
193
- const construction = ({ value, constructed }: Decoded<S["Type"]>): unknown =>
194
- constructed &&
195
- constructorFields.length > 0 &&
196
- typeof value === "object" &&
197
- value !== null
198
- ? Object.fromEntries(
199
- constructorFields.flatMap(({ name }) => {
200
- const property = Object.getOwnPropertyDescriptor(value, name);
201
- return property !== undefined && "value" in property
202
- ? [[name, property.value]]
203
- : [];
204
- }),
205
- )
206
- : undefined;
156
+ const decoded = toDecoded(contract);
207
157
  const written = (
208
158
  reading: ReturnType<typeof decoded>,
209
159
  options?: SchemaAST.ParseOptions,
210
160
  ) =>
211
- Effect.flatMap(reading, (read) => {
212
- const constructed = construction(read);
213
- return Effect.map(write(read.value, options), (output): Written<A> => ({
161
+ Effect.flatMap(reading, (value) =>
162
+ Effect.map(write(value, options), (output): Written<A> => ({
214
163
  output,
215
164
  lost: [],
216
- constructed,
217
- }));
218
- });
165
+ })),
166
+ );
219
167
  if (!Excess.choosing(contract.ast))
220
168
  return (input: Input<S>) => written(decoded(input));
221
- const exact = toDecodedWithEvidence(contract, Excess.strict);
169
+ const exact = toDecoded(contract, Excess.strict);
222
170
  const kept = (input: Input<S>) => written(exact(input), Excess.strict);
223
171
  const compared = (input: Input<S>, given: unknown) =>
224
- Effect.flatMap(decoded(input), (read) => {
225
- const constructed = construction(read);
226
- return Effect.map(
227
- Effect.catch(write(read.value, Excess.strict), () => write(read.value)),
172
+ Effect.flatMap(decoded(input), (value) =>
173
+ Effect.map(
174
+ Effect.catch(write(value, Excess.strict), () => write(value)),
228
175
  (output): Written<A> => ({
229
176
  output,
230
- lost: Excess.missing([contract.ast], given, read.value, output),
231
- constructed,
177
+ lost: Excess.missing([contract.ast], given, value, output),
232
178
  }),
233
- );
234
- });
179
+ ),
180
+ );
235
181
  return (
236
182
  input: Input<S>,
237
183
  ): Effect.Effect<
@@ -253,6 +199,44 @@ export const reader = <S extends Schema.Top, A, R>(
253
199
  };
254
200
  };
255
201
 
202
+ /**
203
+ * Whole-union alternatives for a bare anyOf group. Preserve every member and the whole input:
204
+ * trying one member alone would move its decoder ahead of another member's constructor.
205
+ * Parent behavior is deliberately excluded rather than copied or silently discarded.
206
+ */
207
+ export const reorderedReaders = <S extends Schema.Top>(contract: S) => {
208
+ const ast = contract.ast;
209
+ if (
210
+ ast._tag !== "Union" ||
211
+ (ast.options?.mode ?? "anyOf") !== "anyOf" ||
212
+ ast.encoding !== undefined ||
213
+ ast.context !== undefined ||
214
+ ast.checks !== undefined ||
215
+ ast.encodingChecks !== undefined ||
216
+ (ast.annotations !== undefined &&
217
+ Reflect.ownKeys(ast.annotations).length > 0) ||
218
+ !ast.types.every(
219
+ (member) =>
220
+ member._tag === "Objects" &&
221
+ member.encoding === undefined &&
222
+ member.indexSignatures.length === 0 &&
223
+ !member.propertySignatures.some(({ name }) => name === Symbol.iterator),
224
+ )
225
+ )
226
+ return [];
227
+ // The unchanged order already supplied `original`; repeating it adds no selection alternative.
228
+ return ast.types.slice(1).map((member, offset) => {
229
+ const index = offset + 1;
230
+ const reordered = Schema.make<S>(
231
+ new SchemaAST.Union(
232
+ [member, ...ast.types.filter((_, position) => position !== index)],
233
+ ast.options,
234
+ ),
235
+ );
236
+ return reader(reordered, Schema.encodeEffect(reordered));
237
+ });
238
+ };
239
+
256
240
  /**
257
241
  * Refuse the fields a schema would lose, unless another schema in the group took them. Only a field
258
242
  * of the group itself can be taken, so one further down a value stays lost.