effect 4.0.0-beta.25 → 4.0.0-beta.27

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.
Files changed (155) hide show
  1. package/dist/Cause.d.ts +1 -1
  2. package/dist/Config.js +4 -4
  3. package/dist/Config.js.map +1 -1
  4. package/dist/Data.d.ts +2 -2
  5. package/dist/Data.js +2 -2
  6. package/dist/Effect.d.ts +51 -35
  7. package/dist/Effect.d.ts.map +1 -1
  8. package/dist/Effect.js +16 -12
  9. package/dist/Effect.js.map +1 -1
  10. package/dist/ErrorReporter.d.ts +2 -4
  11. package/dist/ErrorReporter.d.ts.map +1 -1
  12. package/dist/ErrorReporter.js +1 -3
  13. package/dist/ErrorReporter.js.map +1 -1
  14. package/dist/Layer.d.ts +112 -117
  15. package/dist/Layer.d.ts.map +1 -1
  16. package/dist/Layer.js +43 -44
  17. package/dist/Layer.js.map +1 -1
  18. package/dist/LayerMap.d.ts +4 -4
  19. package/dist/LayerMap.js +3 -3
  20. package/dist/ManagedRuntime.d.ts +1 -1
  21. package/dist/ManagedRuntime.js +1 -1
  22. package/dist/Metric.d.ts +2 -4
  23. package/dist/Metric.d.ts.map +1 -1
  24. package/dist/Metric.js +2 -4
  25. package/dist/Metric.js.map +1 -1
  26. package/dist/Runtime.d.ts +66 -0
  27. package/dist/Runtime.d.ts.map +1 -1
  28. package/dist/Runtime.js +72 -5
  29. package/dist/Runtime.js.map +1 -1
  30. package/dist/Schedule.d.ts +36 -36
  31. package/dist/Schedule.js +14 -14
  32. package/dist/Schema.d.ts +15 -32
  33. package/dist/Schema.d.ts.map +1 -1
  34. package/dist/Schema.js +9 -17
  35. package/dist/Schema.js.map +1 -1
  36. package/dist/SchemaAST.js +91 -2
  37. package/dist/SchemaAST.js.map +1 -1
  38. package/dist/SchemaGetter.d.ts +3 -3
  39. package/dist/SchemaRepresentation.d.ts.map +1 -1
  40. package/dist/SchemaRepresentation.js +12 -8
  41. package/dist/SchemaRepresentation.js.map +1 -1
  42. package/dist/Stdio.d.ts +10 -2
  43. package/dist/Stdio.d.ts.map +1 -1
  44. package/dist/Stdio.js +18 -0
  45. package/dist/Stdio.js.map +1 -1
  46. package/dist/index.d.ts +1 -1
  47. package/dist/index.js +1 -1
  48. package/dist/internal/schema/representation.js +7 -3
  49. package/dist/internal/schema/representation.js.map +1 -1
  50. package/dist/internal/schema/to-codec.js +7 -10
  51. package/dist/internal/schema/to-codec.js.map +1 -1
  52. package/dist/unstable/ai/AiError.d.ts +6 -3
  53. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  54. package/dist/unstable/ai/AiError.js +8 -4
  55. package/dist/unstable/ai/AiError.js.map +1 -1
  56. package/dist/unstable/ai/LanguageModel.js +7 -5
  57. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  58. package/dist/unstable/cli/CliError.d.ts +23 -56
  59. package/dist/unstable/cli/CliError.d.ts.map +1 -1
  60. package/dist/unstable/cli/CliError.js +25 -57
  61. package/dist/unstable/cli/CliError.js.map +1 -1
  62. package/dist/unstable/cli/Command.d.ts +117 -62
  63. package/dist/unstable/cli/Command.d.ts.map +1 -1
  64. package/dist/unstable/cli/Command.js +95 -32
  65. package/dist/unstable/cli/Command.js.map +1 -1
  66. package/dist/unstable/cli/GlobalFlag.d.ts +1 -1
  67. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
  68. package/dist/unstable/cli/Primitive.d.ts +1 -1
  69. package/dist/unstable/cli/Primitive.js +1 -1
  70. package/dist/unstable/cli/internal/command.d.ts +27 -10
  71. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  72. package/dist/unstable/cli/internal/command.js +40 -23
  73. package/dist/unstable/cli/internal/command.js.map +1 -1
  74. package/dist/unstable/cli/internal/config.js +42 -0
  75. package/dist/unstable/cli/internal/config.js.map +1 -1
  76. package/dist/unstable/cli/internal/help.d.ts +4 -4
  77. package/dist/unstable/cli/internal/help.d.ts.map +1 -1
  78. package/dist/unstable/cli/internal/help.js +25 -7
  79. package/dist/unstable/cli/internal/help.js.map +1 -1
  80. package/dist/unstable/cli/internal/parser.js +26 -6
  81. package/dist/unstable/cli/internal/parser.js.map +1 -1
  82. package/dist/unstable/http/Headers.d.ts +16 -0
  83. package/dist/unstable/http/Headers.d.ts.map +1 -1
  84. package/dist/unstable/http/Headers.js +11 -0
  85. package/dist/unstable/http/Headers.js.map +1 -1
  86. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  87. package/dist/unstable/httpapi/HttpApiBuilder.js +6 -7
  88. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  89. package/dist/unstable/httpapi/HttpApiClient.d.ts +6 -6
  90. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  91. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  92. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +10 -10
  93. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  94. package/dist/unstable/httpapi/HttpApiEndpoint.js +2 -2
  95. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  96. package/dist/unstable/httpapi/HttpApiError.d.ts +6 -15
  97. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  98. package/dist/unstable/httpapi/HttpApiError.js +16 -21
  99. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  100. package/dist/unstable/reactivity/Atom.d.ts +56 -0
  101. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  102. package/dist/unstable/reactivity/Atom.js +66 -0
  103. package/dist/unstable/reactivity/Atom.js.map +1 -1
  104. package/dist/unstable/reactivity/AtomHttpApi.d.ts +2 -2
  105. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  106. package/dist/unstable/rpc/RpcServer.d.ts +3 -0
  107. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  108. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  109. package/dist/unstable/schema/Model.d.ts +21 -0
  110. package/dist/unstable/schema/Model.d.ts.map +1 -1
  111. package/dist/unstable/schema/Model.js +15 -0
  112. package/dist/unstable/schema/Model.js.map +1 -1
  113. package/dist/unstable/sql/SqlSchema.d.ts +2 -2
  114. package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
  115. package/dist/unstable/sql/SqlSchema.js.map +1 -1
  116. package/package.json +1 -1
  117. package/src/Cause.ts +1 -1
  118. package/src/Config.ts +4 -4
  119. package/src/Data.ts +2 -2
  120. package/src/Effect.ts +60 -31
  121. package/src/ErrorReporter.ts +2 -4
  122. package/src/Layer.ts +112 -117
  123. package/src/LayerMap.ts +4 -4
  124. package/src/ManagedRuntime.ts +1 -1
  125. package/src/Metric.ts +2 -4
  126. package/src/Runtime.ts +95 -5
  127. package/src/Schedule.ts +36 -36
  128. package/src/Schema.ts +20 -52
  129. package/src/SchemaAST.ts +127 -2
  130. package/src/SchemaGetter.ts +3 -3
  131. package/src/SchemaRepresentation.ts +12 -8
  132. package/src/Stdio.ts +21 -2
  133. package/src/index.ts +1 -1
  134. package/src/internal/schema/representation.ts +8 -4
  135. package/src/internal/schema/to-codec.ts +7 -17
  136. package/src/unstable/ai/AiError.ts +8 -4
  137. package/src/unstable/ai/LanguageModel.ts +8 -5
  138. package/src/unstable/cli/CliError.ts +47 -59
  139. package/src/unstable/cli/Command.ts +348 -180
  140. package/src/unstable/cli/GlobalFlag.ts +1 -1
  141. package/src/unstable/cli/Primitive.ts +1 -1
  142. package/src/unstable/cli/internal/command.ts +62 -32
  143. package/src/unstable/cli/internal/config.ts +49 -0
  144. package/src/unstable/cli/internal/help.ts +41 -16
  145. package/src/unstable/cli/internal/parser.ts +36 -10
  146. package/src/unstable/http/Headers.ts +34 -0
  147. package/src/unstable/httpapi/HttpApiBuilder.ts +4 -7
  148. package/src/unstable/httpapi/HttpApiClient.ts +6 -6
  149. package/src/unstable/httpapi/HttpApiEndpoint.ts +4 -4
  150. package/src/unstable/httpapi/HttpApiError.ts +23 -21
  151. package/src/unstable/reactivity/Atom.ts +132 -0
  152. package/src/unstable/reactivity/AtomHttpApi.ts +2 -2
  153. package/src/unstable/rpc/RpcServer.ts +5 -0
  154. package/src/unstable/schema/Model.ts +31 -0
  155. package/src/unstable/sql/SqlSchema.ts +2 -2
@@ -2,30 +2,11 @@
2
2
  * @since 4.0.0
3
3
  */
4
4
  import * as ErrorReporter from "../../ErrorReporter.ts"
5
+ import { identity } from "../../Function.ts"
5
6
  import * as Schema from "../../Schema.ts"
7
+ import * as Transformation from "../../SchemaTransformation.ts"
6
8
  import * as HttpApiSchema from "./HttpApiSchema.ts"
7
9
 
8
- /**
9
- * @category errors
10
- * @since 4.0.0
11
- */
12
- export class HttpApiSchemaError extends Schema.ErrorClass<HttpApiSchemaError>("effect/HttpApiSchemaError")({
13
- _tag: Schema.tag("HttpApiSchemaError"),
14
- message: Schema.String
15
- }, {
16
- httpApiStatus: 400,
17
- description: "The request or response did not match the expected schema"
18
- }) {
19
- /**
20
- * @since 4.0.0
21
- */
22
- static fromSchemaError(error: Schema.SchemaError): HttpApiSchemaError {
23
- return new HttpApiSchemaError({ message: error.message })
24
- }
25
-
26
- override readonly [ErrorReporter.ignore] = true
27
- }
28
-
29
10
  /**
30
11
  * @category Built-in errors
31
12
  * @since 4.0.0
@@ -37,6 +18,7 @@ export class BadRequest extends Schema.ErrorClass<BadRequest>("effect/HttpApiErr
37
18
  httpApiStatus: 400
38
19
  }) {
39
20
  override readonly [ErrorReporter.ignore] = true
21
+ static readonly singleton = new BadRequest()
40
22
  }
41
23
 
42
24
  /**
@@ -47,6 +29,26 @@ export const BadRequestNoContent = BadRequest.pipe(HttpApiSchema.asNoContent({
47
29
  decode: () => new BadRequest({})
48
30
  }))
49
31
 
32
+ /**
33
+ * @category Built-in errors
34
+ * @since 4.0.0
35
+ */
36
+ export const BadRequestFromSchemaError = BadRequest.pipe(
37
+ Schema.decodeTo(
38
+ Schema.Union([Schema.declare(Schema.isSchemaError), BadRequest]),
39
+ Transformation.transform({
40
+ encode: (_) => BadRequest.singleton,
41
+ decode: identity
42
+ })
43
+ ),
44
+ HttpApiSchema.asNoContent({
45
+ decode: () => new BadRequest({})
46
+ })
47
+ ).annotate({
48
+ httpApiStatus: 400,
49
+ description: "BadRequest"
50
+ })
51
+
50
52
  /**
51
53
  * @category Built-in errors
52
54
  * @since 4.0.0
@@ -1750,6 +1750,138 @@ export const withRefresh: {
1750
1750
  }
1751
1751
  )
1752
1752
 
1753
+ /**
1754
+ * Adds stale-while-revalidate refresh behavior to an async result atom.
1755
+ *
1756
+ * Automatic revalidation during reads is skipped while the current value is
1757
+ * fresh within `staleTime`. Manual `refresh` calls remain forceful and always
1758
+ * forward to the wrapped atom.
1759
+ *
1760
+ * Use `revalidateOnMount` to control whether stale data should trigger a
1761
+ * background refresh on first mount. Use `revalidateOnFocus` to control
1762
+ * focus behavior. `true` respects `staleTime` and `"always"` forces refetch.
1763
+ *
1764
+ * @since 4.0.0
1765
+ * @category combinators
1766
+ */
1767
+ export const swr: {
1768
+ /**
1769
+ * Adds stale-while-revalidate refresh behavior to an async result atom.
1770
+ *
1771
+ * Automatic revalidation during reads is skipped while the current value is
1772
+ * fresh within `staleTime`. Manual `refresh` calls remain forceful and always
1773
+ * forward to the wrapped atom.
1774
+ *
1775
+ * Use `revalidateOnMount` to control whether stale data should trigger a
1776
+ * background refresh on first mount. Use `revalidateOnFocus` to control
1777
+ * focus behavior. `true` respects `staleTime` and `"always"` forces refetch.
1778
+ *
1779
+ * @since 4.0.0
1780
+ * @category combinators
1781
+ */
1782
+ (
1783
+ options: {
1784
+ readonly staleTime: Duration.Input
1785
+ readonly revalidateOnMount?: boolean | undefined
1786
+ readonly revalidateOnFocus?: boolean | "always" | undefined
1787
+ readonly focusSignal?: Atom<any> | undefined
1788
+ }
1789
+ ): <R extends Atom<AsyncResult.AsyncResult<any, any>>>(self: R) => WithoutSerializable<R>
1790
+ /**
1791
+ * Adds stale-while-revalidate refresh behavior to an async result atom.
1792
+ *
1793
+ * Automatic revalidation during reads is skipped while the current value is
1794
+ * fresh within `staleTime`. Manual `refresh` calls remain forceful and always
1795
+ * forward to the wrapped atom.
1796
+ *
1797
+ * Use `revalidateOnMount` to control whether stale data should trigger a
1798
+ * background refresh on first mount. Use `revalidateOnFocus` to control
1799
+ * focus behavior. `true` respects `staleTime` and `"always"` forces refetch.
1800
+ *
1801
+ * @since 4.0.0
1802
+ * @category combinators
1803
+ */
1804
+ <R extends Atom<AsyncResult.AsyncResult<any, any>>>(
1805
+ self: R,
1806
+ options: {
1807
+ readonly staleTime: Duration.Input
1808
+ readonly revalidateOnMount?: boolean | undefined
1809
+ readonly revalidateOnFocus?: boolean | "always" | undefined
1810
+ readonly focusSignal?: Atom<any> | undefined
1811
+ }
1812
+ ): WithoutSerializable<R>
1813
+ } = dual(
1814
+ 2,
1815
+ <A, E>(
1816
+ self: Atom<AsyncResult.AsyncResult<A, E>>,
1817
+ options: {
1818
+ readonly staleTime: Duration.Input
1819
+ readonly revalidateOnMount?: boolean | undefined
1820
+ readonly revalidateOnFocus?: boolean | "always" | undefined
1821
+ readonly focusSignal?: Atom<any> | undefined
1822
+ }
1823
+ ): Atom<AsyncResult.AsyncResult<A, E>> => {
1824
+ const staleTime = Duration.toMillis(Duration.fromInputUnsafe(options.staleTime))
1825
+ const refresh = self.refresh ?? function(f: <A>(atom: Atom<A>) => void) {
1826
+ f(self)
1827
+ }
1828
+ function read(get: Context) {
1829
+ const current = get.once(self)
1830
+ get.subscribe(self, (value) => {
1831
+ get.setSelf(value)
1832
+ })
1833
+ if (options.revalidateOnFocus && options.focusSignal) {
1834
+ get.once(options.focusSignal)
1835
+ get.subscribe(
1836
+ options.focusSignal,
1837
+ options.revalidateOnFocus === "always" ? () => get.refresh(self) : () => {
1838
+ const current = get.once(self)
1839
+ if (shouldRevalidateSWR(current, staleTime)) {
1840
+ get.refresh(self)
1841
+ }
1842
+ }
1843
+ )
1844
+ }
1845
+ const firstRead = Option.isNone(get.self<AsyncResult.AsyncResult<A, E>>())
1846
+ if (firstRead && options.revalidateOnMount === false) {
1847
+ return current
1848
+ }
1849
+ if (shouldRevalidateSWR(current, staleTime)) {
1850
+ get.refresh(self)
1851
+ }
1852
+ return current
1853
+ }
1854
+ return isWritable(self)
1855
+ ? writable(read, (ctx, value) => {
1856
+ ctx.set(self, value)
1857
+ }, refresh)
1858
+ : readable(read, refresh)
1859
+ }
1860
+ ) as any
1861
+
1862
+ const swrTimestamp = <A, E>(result: AsyncResult.AsyncResult<A, E>): Option.Option<number> => {
1863
+ if (result._tag === "Success") {
1864
+ return Option.some(result.timestamp)
1865
+ }
1866
+ if (result._tag === "Failure") {
1867
+ return Option.map(result.previousSuccess, (success) => success.timestamp)
1868
+ }
1869
+ return Option.none()
1870
+ }
1871
+
1872
+ const isFreshWithin = (timestamp: number, staleTime: number, now: number): boolean => now - timestamp < staleTime
1873
+
1874
+ const shouldRevalidateSWR = <A, E>(result: AsyncResult.AsyncResult<A, E>, staleTime: number): boolean => {
1875
+ if (result.waiting) {
1876
+ return false
1877
+ }
1878
+ const timestamp = Option.getOrUndefined(swrTimestamp(result))
1879
+ if (timestamp === undefined) {
1880
+ return result._tag !== "Initial"
1881
+ }
1882
+ return !isFreshWithin(timestamp, staleTime, Date.now())
1883
+ }
1884
+
1753
1885
  /**
1754
1886
  * @since 4.0.0
1755
1887
  * @category Optimistic
@@ -67,7 +67,7 @@ export interface AtomHttpApiClient<Self, Id extends string, Groups extends HttpA
67
67
  }
68
68
  >,
69
69
  WithResponse extends true ? [_Success["Type"], HttpClientResponse] : _Success["Type"],
70
- _Error | HttpClientError.HttpClientError | SchemaError
70
+ _Error["Type"] | HttpClientError.HttpClientError | SchemaError
71
71
  >
72
72
  : never
73
73
 
@@ -124,7 +124,7 @@ export interface AtomHttpApiClient<Self, Id extends string, Groups extends HttpA
124
124
  ] ? Atom.Atom<
125
125
  AsyncResult.AsyncResult<
126
126
  WithResponse extends true ? [_Success["Type"], HttpClientResponse] : _Success["Type"],
127
- _Error | HttpClientError.HttpClientError | SchemaError
127
+ _Error["Type"] | HttpClientError.HttpClientError | SchemaError
128
128
  >
129
129
  >
130
130
  : never
@@ -739,6 +739,7 @@ export const layerHttp = <Rpcs extends Rpc.Any>(options: {
739
739
  readonly spanPrefix?: string | undefined
740
740
  readonly spanAttributes?: Record<string, unknown> | undefined
741
741
  readonly concurrency?: number | "unbounded" | undefined
742
+ readonly disableFatalDefects?: boolean | undefined
742
743
  }): Layer.Layer<
743
744
  never,
744
745
  never,
@@ -1080,6 +1081,7 @@ export const toHttpEffect: <Rpcs extends Rpc.Any>(
1080
1081
  readonly disableTracing?: boolean | undefined
1081
1082
  readonly spanPrefix?: string | undefined
1082
1083
  readonly spanAttributes?: Record<string, unknown> | undefined
1084
+ readonly disableFatalDefects?: boolean | undefined
1083
1085
  } | undefined
1084
1086
  ) => Effect.Effect<
1085
1087
  Effect.Effect<HttpServerResponse.HttpServerResponse, never, Scope.Scope | HttpServerRequest.HttpServerRequest>,
@@ -1095,6 +1097,7 @@ export const toHttpEffect: <Rpcs extends Rpc.Any>(
1095
1097
  readonly disableTracing?: boolean | undefined
1096
1098
  readonly spanPrefix?: string | undefined
1097
1099
  readonly spanAttributes?: Record<string, unknown> | undefined
1100
+ readonly disableFatalDefects?: boolean | undefined
1098
1101
  }
1099
1102
  ) {
1100
1103
  const { httpEffect, protocol } = yield* makeProtocolWithHttpEffect
@@ -1116,6 +1119,7 @@ export const toHttpEffectWebsocket: <Rpcs extends Rpc.Any>(
1116
1119
  readonly disableTracing?: boolean | undefined
1117
1120
  readonly spanPrefix?: string | undefined
1118
1121
  readonly spanAttributes?: Record<string, unknown> | undefined
1122
+ readonly disableFatalDefects?: boolean | undefined
1119
1123
  } | undefined
1120
1124
  ) => Effect.Effect<
1121
1125
  Effect.Effect<HttpServerResponse.HttpServerResponse, never, Scope.Scope | HttpServerRequest.HttpServerRequest>,
@@ -1131,6 +1135,7 @@ export const toHttpEffectWebsocket: <Rpcs extends Rpc.Any>(
1131
1135
  readonly disableTracing?: boolean | undefined
1132
1136
  readonly spanPrefix?: string | undefined
1133
1137
  readonly spanAttributes?: Record<string, unknown> | undefined
1138
+ readonly disableFatalDefects?: boolean | undefined
1134
1139
  }
1135
1140
  ) {
1136
1141
  const { httpEffect, protocol } = yield* makeProtocolWithHttpEffectWebsocket
@@ -301,6 +301,37 @@ export const FieldOption: <Field extends VariantSchema.Field<any> | Schema.Top>(
301
301
  jsonUpdate: optionalOption
302
302
  }) as any
303
303
 
304
+ /**
305
+ * @since 4.0.0
306
+ * @category booleans
307
+ */
308
+ export interface BooleanSqlite extends
309
+ VariantSchema.Field<{
310
+ readonly select: Schema.BooleanFromBit
311
+ readonly insert: Schema.BooleanFromBit
312
+ readonly update: Schema.BooleanFromBit
313
+ readonly json: Schema.Boolean
314
+ readonly jsonCreate: Schema.Boolean
315
+ readonly jsonUpdate: Schema.Boolean
316
+ }>
317
+ {}
318
+
319
+ /**
320
+ * A schema for sqlite booleans that are represented as `0 | 1` in database
321
+ * variants and `boolean` in JSON variants.
322
+ *
323
+ * @since 4.0.0
324
+ * @category booleans
325
+ */
326
+ export const BooleanSqlite: BooleanSqlite = Field({
327
+ select: Schema.BooleanFromBit,
328
+ insert: Schema.BooleanFromBit,
329
+ update: Schema.BooleanFromBit,
330
+ json: Schema.Boolean,
331
+ jsonCreate: Schema.Boolean,
332
+ jsonUpdate: Schema.Boolean
333
+ })
334
+
304
335
  /**
305
336
  * @since 4.0.0
306
337
  * @category date & time
@@ -23,7 +23,7 @@ export const findAll = <Req extends Schema.Top, Res extends Schema.Top, E, R>(
23
23
  const encodeRequest = Schema.encodeEffect(options.Request)
24
24
  const decode = Schema.decodeUnknownEffect(Schema.mutable(Schema.Array(options.Result)))
25
25
  return (
26
- request: Req["Encoded"]
26
+ request: Req["Type"]
27
27
  ): Effect.Effect<
28
28
  Array<Res["Type"]>,
29
29
  E | Schema.SchemaError,
@@ -46,7 +46,7 @@ export const findNonEmpty = <Req extends Schema.Top, Res extends Schema.Top, E,
46
46
  ) => {
47
47
  const find = findAll(options)
48
48
  return (
49
- request: Req["Encoded"]
49
+ request: Req["Type"]
50
50
  ): Effect.Effect<
51
51
  Arr.NonEmptyArray<Res["Type"]>,
52
52
  E | Schema.SchemaError | Cause.NoSuchElementError,