@effect/platform 0.17.0 → 0.18.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.
Files changed (256) hide show
  1. package/Command.d.ts +7 -7
  2. package/Command.d.ts.map +1 -1
  3. package/Command.js.map +1 -1
  4. package/CommandExecutor.d.ts +5 -5
  5. package/CommandExecutor.d.ts.map +1 -1
  6. package/CommandExecutor.js.map +1 -1
  7. package/Effectify.d.ts +1 -4
  8. package/Effectify.d.ts.map +1 -1
  9. package/Effectify.js +4 -0
  10. package/Effectify.js.map +1 -1
  11. package/Error.d.ts +1 -4
  12. package/Error.d.ts.map +1 -1
  13. package/Error.js +4 -0
  14. package/Error.js.map +1 -1
  15. package/FileSystem.d.ts +7 -7
  16. package/FileSystem.d.ts.map +1 -1
  17. package/FileSystem.js +1 -5
  18. package/FileSystem.js.map +1 -1
  19. package/Http/App.d.ts +1 -1
  20. package/Http/App.d.ts.map +1 -1
  21. package/Http/Body.d.ts +3 -3
  22. package/Http/Body.d.ts.map +1 -1
  23. package/Http/Body.js.map +1 -1
  24. package/Http/Client.d.ts +24 -8
  25. package/Http/Client.d.ts.map +1 -1
  26. package/Http/Client.js +11 -1
  27. package/Http/Client.js.map +1 -1
  28. package/Http/ClientError.d.ts +1 -1
  29. package/Http/ClientError.d.ts.map +1 -1
  30. package/Http/ClientError.js.map +1 -1
  31. package/Http/ClientRequest.d.ts +3 -3
  32. package/Http/ClientRequest.d.ts.map +1 -1
  33. package/Http/ClientRequest.js.map +1 -1
  34. package/Http/ClientResponse.d.ts +1 -1
  35. package/Http/ClientResponse.d.ts.map +1 -1
  36. package/Http/ClientResponse.js.map +1 -1
  37. package/Http/Etag.d.ts +2 -2
  38. package/Http/Etag.d.ts.map +1 -1
  39. package/Http/Etag.js.map +1 -1
  40. package/Http/FormData.d.ts +6 -6
  41. package/Http/FormData.d.ts.map +1 -1
  42. package/Http/FormData.js.map +1 -1
  43. package/Http/Headers.d.ts +2 -2
  44. package/Http/Headers.d.ts.map +1 -1
  45. package/Http/Headers.js +3 -3
  46. package/Http/Headers.js.map +1 -1
  47. package/Http/IncomingMessage.d.ts +8 -5
  48. package/Http/IncomingMessage.d.ts.map +1 -1
  49. package/Http/IncomingMessage.js +6 -6
  50. package/Http/IncomingMessage.js.map +1 -1
  51. package/Http/Platform.d.ts +2 -2
  52. package/Http/Platform.d.ts.map +1 -1
  53. package/Http/Platform.js.map +1 -1
  54. package/Http/Router.d.ts +5 -5
  55. package/Http/Router.d.ts.map +1 -1
  56. package/Http/Router.js.map +1 -1
  57. package/Http/Server.d.ts +3 -3
  58. package/Http/Server.d.ts.map +1 -1
  59. package/Http/Server.js.map +1 -1
  60. package/Http/ServerError.d.ts +1 -1
  61. package/Http/ServerError.d.ts.map +1 -1
  62. package/Http/ServerError.js.map +1 -1
  63. package/Http/ServerRequest.d.ts +4 -4
  64. package/Http/ServerRequest.d.ts.map +1 -1
  65. package/Http/ServerRequest.js.map +1 -1
  66. package/Http/ServerResponse.d.ts +3 -3
  67. package/Http/ServerResponse.d.ts.map +1 -1
  68. package/Http/ServerResponse.js.map +1 -1
  69. package/Http/UrlParams.d.ts +2 -2
  70. package/Http/UrlParams.d.ts.map +1 -1
  71. package/Http/UrlParams.js +3 -3
  72. package/Http/UrlParams.js.map +1 -1
  73. package/KeyValueStore.d.ts +4 -4
  74. package/KeyValueStore.d.ts.map +1 -1
  75. package/KeyValueStore.js.map +1 -1
  76. package/Path.d.ts +3 -3
  77. package/Path.d.ts.map +1 -1
  78. package/Path.js.map +1 -1
  79. package/Runtime.d.ts +2 -2
  80. package/Runtime.d.ts.map +1 -1
  81. package/Runtime.js +2 -2
  82. package/Runtime.js.map +1 -1
  83. package/index.d.ts +41 -0
  84. package/index.d.ts.map +1 -0
  85. package/index.js +29 -0
  86. package/index.js.map +1 -0
  87. package/internal/command.js +7 -7
  88. package/internal/command.js.map +1 -1
  89. package/internal/commandExecutor.js +10 -9
  90. package/internal/commandExecutor.js.map +1 -1
  91. package/internal/effectify.js +1 -1
  92. package/internal/effectify.js.map +1 -1
  93. package/internal/error.js +1 -1
  94. package/internal/error.js.map +1 -1
  95. package/internal/fileSystem.js +11 -11
  96. package/internal/fileSystem.js.map +1 -1
  97. package/internal/http/body.js +4 -4
  98. package/internal/http/body.js.map +1 -1
  99. package/internal/http/client.d.ts +1 -2
  100. package/internal/http/client.d.ts.map +1 -1
  101. package/internal/http/client.js +30 -26
  102. package/internal/http/client.js.map +1 -1
  103. package/internal/http/clientError.js +1 -1
  104. package/internal/http/clientError.js.map +1 -1
  105. package/internal/http/clientRequest.js +3 -3
  106. package/internal/http/clientRequest.js.map +1 -1
  107. package/internal/http/clientResponse.js +3 -3
  108. package/internal/http/clientResponse.js.map +1 -1
  109. package/internal/http/etag.js +1 -1
  110. package/internal/http/etag.js.map +1 -1
  111. package/internal/http/formData.js +12 -12
  112. package/internal/http/formData.js.map +1 -1
  113. package/internal/http/middleware.js +2 -2
  114. package/internal/http/middleware.js.map +1 -1
  115. package/internal/http/platform.js +7 -6
  116. package/internal/http/platform.js.map +1 -1
  117. package/internal/http/router.d.ts +1 -1
  118. package/internal/http/router.d.ts.map +1 -1
  119. package/internal/http/router.js +9 -28
  120. package/internal/http/router.js.map +1 -1
  121. package/internal/http/server.js +3 -3
  122. package/internal/http/server.js.map +1 -1
  123. package/internal/http/serverError.js +1 -1
  124. package/internal/http/serverError.js.map +1 -1
  125. package/internal/http/serverRequest.js +2 -2
  126. package/internal/http/serverRequest.js.map +1 -1
  127. package/internal/http/serverResponse.js +3 -3
  128. package/internal/http/serverResponse.js.map +1 -1
  129. package/internal/keyValueStore.js +6 -6
  130. package/internal/keyValueStore.js.map +1 -1
  131. package/internal/path.js +4 -4
  132. package/internal/path.js.map +1 -1
  133. package/mjs/Command.mjs.map +1 -1
  134. package/mjs/CommandExecutor.mjs.map +1 -1
  135. package/mjs/Effectify.mjs +3 -0
  136. package/mjs/Effectify.mjs.map +1 -1
  137. package/mjs/Error.mjs +3 -0
  138. package/mjs/Error.mjs.map +1 -1
  139. package/mjs/FileSystem.mjs +1 -4
  140. package/mjs/FileSystem.mjs.map +1 -1
  141. package/mjs/Http/Body.mjs.map +1 -1
  142. package/mjs/Http/Client.mjs +10 -0
  143. package/mjs/Http/Client.mjs.map +1 -1
  144. package/mjs/Http/ClientError.mjs.map +1 -1
  145. package/mjs/Http/ClientRequest.mjs.map +1 -1
  146. package/mjs/Http/ClientResponse.mjs.map +1 -1
  147. package/mjs/Http/Etag.mjs.map +1 -1
  148. package/mjs/Http/FormData.mjs.map +1 -1
  149. package/mjs/Http/Headers.mjs +3 -3
  150. package/mjs/Http/Headers.mjs.map +1 -1
  151. package/mjs/Http/IncomingMessage.mjs +6 -6
  152. package/mjs/Http/IncomingMessage.mjs.map +1 -1
  153. package/mjs/Http/Platform.mjs.map +1 -1
  154. package/mjs/Http/Router.mjs.map +1 -1
  155. package/mjs/Http/Server.mjs.map +1 -1
  156. package/mjs/Http/ServerError.mjs.map +1 -1
  157. package/mjs/Http/ServerRequest.mjs.map +1 -1
  158. package/mjs/Http/ServerResponse.mjs.map +1 -1
  159. package/mjs/Http/UrlParams.mjs +3 -3
  160. package/mjs/Http/UrlParams.mjs.map +1 -1
  161. package/mjs/KeyValueStore.mjs.map +1 -1
  162. package/mjs/Path.mjs.map +1 -1
  163. package/mjs/Runtime.mjs +2 -2
  164. package/mjs/Runtime.mjs.map +1 -1
  165. package/mjs/index.mjs +21 -0
  166. package/mjs/index.mjs.map +1 -0
  167. package/mjs/internal/command.mjs +7 -7
  168. package/mjs/internal/command.mjs.map +1 -1
  169. package/mjs/internal/commandExecutor.mjs +10 -9
  170. package/mjs/internal/commandExecutor.mjs.map +1 -1
  171. package/mjs/internal/effectify.mjs +1 -1
  172. package/mjs/internal/effectify.mjs.map +1 -1
  173. package/mjs/internal/error.mjs +1 -1
  174. package/mjs/internal/error.mjs.map +1 -1
  175. package/mjs/internal/fileSystem.mjs +11 -11
  176. package/mjs/internal/fileSystem.mjs.map +1 -1
  177. package/mjs/internal/http/body.mjs +4 -4
  178. package/mjs/internal/http/body.mjs.map +1 -1
  179. package/mjs/internal/http/client.mjs +29 -25
  180. package/mjs/internal/http/client.mjs.map +1 -1
  181. package/mjs/internal/http/clientError.mjs +1 -1
  182. package/mjs/internal/http/clientError.mjs.map +1 -1
  183. package/mjs/internal/http/clientRequest.mjs +3 -3
  184. package/mjs/internal/http/clientRequest.mjs.map +1 -1
  185. package/mjs/internal/http/clientResponse.mjs +3 -3
  186. package/mjs/internal/http/clientResponse.mjs.map +1 -1
  187. package/mjs/internal/http/etag.mjs +1 -1
  188. package/mjs/internal/http/etag.mjs.map +1 -1
  189. package/mjs/internal/http/formData.mjs +12 -12
  190. package/mjs/internal/http/formData.mjs.map +1 -1
  191. package/mjs/internal/http/middleware.mjs +2 -2
  192. package/mjs/internal/http/middleware.mjs.map +1 -1
  193. package/mjs/internal/http/platform.mjs +7 -6
  194. package/mjs/internal/http/platform.mjs.map +1 -1
  195. package/mjs/internal/http/router.mjs +9 -28
  196. package/mjs/internal/http/router.mjs.map +1 -1
  197. package/mjs/internal/http/server.mjs +3 -3
  198. package/mjs/internal/http/server.mjs.map +1 -1
  199. package/mjs/internal/http/serverError.mjs +1 -1
  200. package/mjs/internal/http/serverError.mjs.map +1 -1
  201. package/mjs/internal/http/serverRequest.mjs +2 -2
  202. package/mjs/internal/http/serverRequest.mjs.map +1 -1
  203. package/mjs/internal/http/serverResponse.mjs +3 -3
  204. package/mjs/internal/http/serverResponse.mjs.map +1 -1
  205. package/mjs/internal/keyValueStore.mjs +6 -6
  206. package/mjs/internal/keyValueStore.mjs.map +1 -1
  207. package/mjs/internal/path.mjs +4 -4
  208. package/mjs/internal/path.mjs.map +1 -1
  209. package/package.json +14 -5
  210. package/src/Command.ts +7 -7
  211. package/src/CommandExecutor.ts +5 -5
  212. package/src/Effectify.ts +1 -1
  213. package/src/Error.ts +1 -1
  214. package/src/FileSystem.ts +7 -7
  215. package/src/Http/App.ts +1 -1
  216. package/src/Http/Body.ts +3 -3
  217. package/src/Http/Client.ts +37 -12
  218. package/src/Http/ClientError.ts +1 -1
  219. package/src/Http/ClientRequest.ts +3 -3
  220. package/src/Http/ClientResponse.ts +1 -1
  221. package/src/Http/Etag.ts +2 -2
  222. package/src/Http/FormData.ts +6 -6
  223. package/src/Http/Headers.ts +4 -4
  224. package/src/Http/IncomingMessage.ts +8 -8
  225. package/src/Http/Platform.ts +2 -2
  226. package/src/Http/Router.ts +5 -5
  227. package/src/Http/Server.ts +3 -3
  228. package/src/Http/ServerError.ts +1 -1
  229. package/src/Http/ServerRequest.ts +4 -4
  230. package/src/Http/ServerResponse.ts +3 -3
  231. package/src/Http/UrlParams.ts +3 -3
  232. package/src/KeyValueStore.ts +4 -4
  233. package/src/Path.ts +3 -3
  234. package/src/Runtime.ts +3 -3
  235. package/src/index.ts +49 -0
  236. package/src/internal/command.ts +8 -8
  237. package/src/internal/commandExecutor.ts +7 -7
  238. package/src/internal/effectify.ts +1 -1
  239. package/src/internal/error.ts +1 -1
  240. package/src/internal/fileSystem.ts +6 -6
  241. package/src/internal/http/body.ts +4 -4
  242. package/src/internal/http/client.ts +49 -33
  243. package/src/internal/http/clientError.ts +1 -1
  244. package/src/internal/http/clientRequest.ts +4 -4
  245. package/src/internal/http/clientResponse.ts +3 -3
  246. package/src/internal/http/etag.ts +1 -1
  247. package/src/internal/http/formData.ts +9 -9
  248. package/src/internal/http/middleware.ts +2 -2
  249. package/src/internal/http/platform.ts +3 -3
  250. package/src/internal/http/router.ts +19 -40
  251. package/src/internal/http/server.ts +4 -4
  252. package/src/internal/http/serverError.ts +1 -1
  253. package/src/internal/http/serverRequest.ts +2 -2
  254. package/src/internal/http/serverResponse.ts +4 -4
  255. package/src/internal/keyValueStore.ts +5 -5
  256. package/src/internal/path.ts +4 -4
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @since 1.0.0
3
3
  */
4
- import * as Chunk from "@effect/data/Chunk"
5
- import { dual } from "@effect/data/Function"
6
- import * as Effect from "@effect/io/Effect"
4
+ import * as Chunk from "effect/Chunk"
5
+ import * as Effect from "effect/Effect"
6
+ import { dual } from "effect/Function"
7
7
 
8
8
  /**
9
9
  * @since 1.0.0
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * @since 1.0.0
3
3
  */
4
- import type * as Context from "@effect/data/Context"
5
- import type * as Option from "@effect/data/Option"
6
- import type * as Effect from "@effect/io/Effect"
7
- import type * as Layer from "@effect/io/Layer"
8
4
  import type * as PlatformError from "@effect/platform/Error"
9
5
  import type * as FileSystem from "@effect/platform/FileSystem"
10
6
  import * as internal from "@effect/platform/internal/keyValueStore"
11
7
  import type * as Path from "@effect/platform/Path"
12
8
  import type * as ParseResult from "@effect/schema/ParseResult"
13
9
  import type * as Schema from "@effect/schema/Schema"
10
+ import type * as Context from "effect/Context"
11
+ import type * as Effect from "effect/Effect"
12
+ import type * as Layer from "effect/Layer"
13
+ import type * as Option from "effect/Option"
14
14
 
15
15
  /**
16
16
  * @since 1.0.0
package/src/Path.ts CHANGED
@@ -2,11 +2,11 @@
2
2
  * @since 1.0.0
3
3
  */
4
4
 
5
- import type { Tag } from "@effect/data/Context"
6
- import type { Effect } from "@effect/io/Effect"
7
- import type { Layer } from "@effect/io/Layer"
8
5
  import type { BadArgument } from "@effect/platform/Error"
9
6
  import * as internal from "@effect/platform/internal/path"
7
+ import type { Tag } from "effect/Context"
8
+ import type { Effect } from "effect/Effect"
9
+ import type { Layer } from "effect/Layer"
10
10
 
11
11
  /**
12
12
  * @since 1.0.0
package/src/Runtime.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @since 1.0.0
3
3
  */
4
- import * as Cause from "@effect/io/Cause"
5
- import type { Effect } from "@effect/io/Effect"
6
- import * as Exit from "@effect/io/Exit"
4
+ import * as Cause from "effect/Cause"
5
+ import type { Effect } from "effect/Effect"
6
+ import * as Exit from "effect/Exit"
7
7
 
8
8
  /**
9
9
  * @category model
package/src/index.ts ADDED
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ export * as Command from "@effect/platform/Command"
5
+
6
+ /**
7
+ * @since 1.0.0
8
+ */
9
+ export * as CommandExecutor from "@effect/platform/CommandExecutor"
10
+
11
+ /**
12
+ * @since 1.0.0
13
+ */
14
+ export * as Effectify from "@effect/platform/Effectify"
15
+
16
+ /**
17
+ * @since 1.0.0
18
+ */
19
+ export * as Error from "@effect/platform/Error"
20
+
21
+ /**
22
+ * @since 1.0.0
23
+ */
24
+ export * as FileSystem from "@effect/platform/FileSystem"
25
+
26
+ /**
27
+ * @since 1.0.0
28
+ */
29
+ export * as HttpClient from "@effect/platform/HttpClient"
30
+
31
+ /**
32
+ * @since 1.0.0
33
+ */
34
+ export * as HttpServer from "@effect/platform/HttpServer"
35
+
36
+ /**
37
+ * @since 1.0.0
38
+ */
39
+ export * as KeyValueStore from "@effect/platform/KeyValueStore"
40
+
41
+ /**
42
+ * @since 1.0.0
43
+ */
44
+ export * as Path from "@effect/platform/Path"
45
+
46
+ /**
47
+ * @since 1.0.0
48
+ */
49
+ export * as Runtime from "@effect/platform/Runtime"
@@ -1,15 +1,15 @@
1
- import * as Chunk from "@effect/data/Chunk"
2
- import { dual } from "@effect/data/Function"
3
- import * as HashMap from "@effect/data/HashMap"
4
- import * as Option from "@effect/data/Option"
5
- import { pipeArguments } from "@effect/data/Pipeable"
6
- import type ReadonlyArray from "@effect/data/ReadonlyArray"
7
- import * as Effect from "@effect/io/Effect"
8
1
  import type * as Command from "@effect/platform/Command"
9
2
  import type * as CommandExecutor from "@effect/platform/CommandExecutor"
10
3
  import type { PlatformError } from "@effect/platform/Error"
11
4
  import * as commandExecutor from "@effect/platform/internal/commandExecutor"
12
- import * as Stream from "@effect/stream/Stream"
5
+ import * as Chunk from "effect/Chunk"
6
+ import * as Effect from "effect/Effect"
7
+ import { dual } from "effect/Function"
8
+ import * as HashMap from "effect/HashMap"
9
+ import * as Option from "effect/Option"
10
+ import { pipeArguments } from "effect/Pipeable"
11
+ import type ReadonlyArray from "effect/ReadonlyArray"
12
+ import * as Stream from "effect/Stream"
13
13
 
14
14
  /** @internal */
15
15
  export const CommandTypeId: Command.CommandTypeId = Symbol.for("@effect/platform/Command") as Command.CommandTypeId
@@ -1,11 +1,11 @@
1
- import * as Brand from "@effect/data/Brand"
2
- import * as Chunk from "@effect/data/Chunk"
3
- import { Tag } from "@effect/data/Context"
4
- import { pipe } from "@effect/data/Function"
5
- import * as Effect from "@effect/io/Effect"
6
1
  import type * as _CommandExecutor from "@effect/platform/CommandExecutor"
7
- import * as Sink from "@effect/stream/Sink"
8
- import * as Stream from "@effect/stream/Stream"
2
+ import * as Brand from "effect/Brand"
3
+ import * as Chunk from "effect/Chunk"
4
+ import { Tag } from "effect/Context"
5
+ import * as Effect from "effect/Effect"
6
+ import { pipe } from "effect/Function"
7
+ import * as Sink from "effect/Sink"
8
+ import * as Stream from "effect/Stream"
9
9
 
10
10
  /** @internal */
11
11
  export const ProcessTypeId: _CommandExecutor.ProcessTypeId = Symbol.for(
@@ -1,5 +1,5 @@
1
- import * as Effect from "@effect/io/Effect"
2
1
  import type { Effectify, EffectifyError } from "@effect/platform/Effectify"
2
+ import * as Effect from "effect/Effect"
3
3
 
4
4
  /** @internal */
5
5
  export const effectify: {
@@ -1,5 +1,5 @@
1
- import * as Data from "@effect/data/Data"
2
1
  import type * as Error from "@effect/platform/Error"
2
+ import * as Data from "effect/Data"
3
3
 
4
4
  /** @internal */
5
5
  export const PlatformErrorTypeId: Error.PlatformErrorTypeId = Symbol.for(
@@ -1,11 +1,11 @@
1
- import { Tag } from "@effect/data/Context"
2
- import { identity, pipe } from "@effect/data/Function"
3
- import * as Option from "@effect/data/Option"
4
- import * as Effect from "@effect/io/Effect"
5
1
  import * as Error from "@effect/platform/Error"
6
2
  import type { File, FileSystem, Size as Size_, SizeInput, StreamOptions } from "@effect/platform/FileSystem"
7
- import * as Sink from "@effect/stream/Sink"
8
- import * as Stream from "@effect/stream/Stream"
3
+ import { Tag } from "effect/Context"
4
+ import * as Effect from "effect/Effect"
5
+ import { identity, pipe } from "effect/Function"
6
+ import * as Option from "effect/Option"
7
+ import * as Sink from "effect/Sink"
8
+ import * as Stream from "effect/Stream"
9
9
 
10
10
  /** @internal */
11
11
  export const tag = Tag<FileSystem>("@effect/platform/FileSystem")
@@ -1,11 +1,11 @@
1
- import * as Data from "@effect/data/Data"
2
- import { identity } from "@effect/data/Function"
3
- import * as Effect from "@effect/io/Effect"
4
1
  import type * as PlatformError from "@effect/platform/Error"
5
2
  import * as FileSystem from "@effect/platform/FileSystem"
6
3
  import type * as Body from "@effect/platform/Http/Body"
7
4
  import * as Schema from "@effect/schema/Schema"
8
- import * as Stream_ from "@effect/stream/Stream"
5
+ import * as Data from "effect/Data"
6
+ import * as Effect from "effect/Effect"
7
+ import { identity } from "effect/Function"
8
+ import * as Stream_ from "effect/Stream"
9
9
 
10
10
  /** @internal */
11
11
  export const TypeId: Body.TypeId = Symbol.for(
@@ -1,17 +1,7 @@
1
- import * as Context from "@effect/data/Context"
2
- import { dual, pipe } from "@effect/data/Function"
3
- import * as Option from "@effect/data/Option"
4
- import { pipeArguments } from "@effect/data/Pipeable"
5
- import type * as Predicate from "@effect/data/Predicate"
6
- import * as Effect from "@effect/io/Effect"
7
- import * as Layer from "@effect/io/Layer"
8
- import type * as Schedule from "@effect/io/Schedule"
9
- import type * as Scope from "@effect/io/Scope"
10
1
  import type * as Body from "@effect/platform/Http/Body"
11
2
  import type * as Client from "@effect/platform/Http/Client"
12
3
  import type * as Error from "@effect/platform/Http/ClientError"
13
4
  import type * as ClientRequest from "@effect/platform/Http/ClientRequest"
14
- import type * as ClientResponse from "@effect/platform/Http/ClientResponse"
15
5
  import * as IncomingMessage from "@effect/platform/Http/IncomingMessage"
16
6
  import * as Method from "@effect/platform/Http/Method"
17
7
  import * as UrlParams from "@effect/platform/Http/UrlParams"
@@ -21,7 +11,16 @@ import * as internalRequest from "@effect/platform/internal/http/clientRequest"
21
11
  import * as internalResponse from "@effect/platform/internal/http/clientResponse"
22
12
  import type * as ParseResult from "@effect/schema/ParseResult"
23
13
  import * as Schema from "@effect/schema/Schema"
24
- import * as Stream from "@effect/stream/Stream"
14
+ import * as Context from "effect/Context"
15
+ import * as Effect from "effect/Effect"
16
+ import { dual, pipe } from "effect/Function"
17
+ import * as Layer from "effect/Layer"
18
+ import * as Option from "effect/Option"
19
+ import { pipeArguments } from "effect/Pipeable"
20
+ import type * as Predicate from "effect/Predicate"
21
+ import type * as Schedule from "effect/Schedule"
22
+ import type * as Scope from "effect/Scope"
23
+ import * as Stream from "effect/Stream"
25
24
 
26
25
  /** @internal */
27
26
  export const TypeId: Client.TypeId = Symbol.for("@effect/platform/Http/Client") as Client.TypeId
@@ -36,20 +35,14 @@ const clientProto = {
36
35
  }
37
36
  }
38
37
 
39
- const setProto = <R, E, A>(
38
+ /** @internal */
39
+ export const make = <R, E, A>(
40
40
  f: (request: ClientRequest.ClientRequest) => Effect.Effect<R, E, A>
41
41
  ) => {
42
42
  Object.setPrototypeOf(f, clientProto)
43
43
  return f as Client.Client<R, E, A>
44
44
  }
45
45
 
46
- /** @internal */
47
- export const make = (
48
- f: (
49
- request: ClientRequest.ClientRequest
50
- ) => Effect.Effect<never, Error.HttpClientError, ClientResponse.ClientResponse>
51
- ): Client.Client.Default => setProto(f)
52
-
53
46
  /** @internal */
54
47
  export const fetch = (
55
48
  options: RequestInit = {}
@@ -108,6 +101,7 @@ const convertBody = (body: Body.Body): BodyInit | undefined => {
108
101
  }
109
102
  }
110
103
 
104
+ /** @internal */
111
105
  export const fetchOk = (
112
106
  options: RequestInit = {}
113
107
  ): Client.Client.Default => filterStatusOk(fetch(options))
@@ -115,6 +109,28 @@ export const fetchOk = (
115
109
  /** @internal */
116
110
  export const layer = Layer.succeed(tag, fetch())
117
111
 
112
+ /** @internal */
113
+ export const transform = dual<
114
+ <R, E, A, R1, E1, A1>(
115
+ f: (client: Client.Client<R, E, A>) => (request: ClientRequest.ClientRequest) => Effect.Effect<R1, E1, A1>
116
+ ) => (self: Client.Client<R, E, A>) => Client.Client<R1, E1, A1>,
117
+ <R, E, A, R1, E1, A1>(
118
+ self: Client.Client<R, E, A>,
119
+ f: (client: Client.Client<R, E, A>) => (request: ClientRequest.ClientRequest) => Effect.Effect<R1, E1, A1>
120
+ ) => Client.Client<R1, E1, A1>
121
+ >(2, (self, f) => make(f(self)))
122
+
123
+ /** @internal */
124
+ export const transformResponse = dual<
125
+ <R, E, A, R1, E1, A1>(
126
+ f: (effect: Effect.Effect<R, E, A>) => Effect.Effect<R1, E1, A1>
127
+ ) => (self: Client.Client<R, E, A>) => Client.Client<R1, E1, A1>,
128
+ <R, E, A, R1, E1, A1>(
129
+ self: Client.Client<R, E, A>,
130
+ f: (effect: Effect.Effect<R, E, A>) => Effect.Effect<R1, E1, A1>
131
+ ) => Client.Client<R1, E1, A1>
132
+ >(2, (self, f) => make((request) => f(self(request))))
133
+
118
134
  /** @internal */
119
135
  export const catchTag: {
120
136
  <K extends (E extends { _tag: string } ? E["_tag"] : never), E, R1, E1, A1>(
@@ -135,7 +151,7 @@ export const catchTag: {
135
151
  tag: K,
136
152
  f: (e: Extract<E, { _tag: K }>) => Effect.Effect<R1, E1, A1>
137
153
  ): Client.Client<R1 | R, E1 | Exclude<E, { _tag: K }>, A1 | A> =>
138
- setProto((request) => Effect.catchTag(self(request), tag, f))
154
+ make((request) => Effect.catchTag(self(request), tag, f))
139
155
  )
140
156
 
141
157
  /** @internal */
@@ -242,7 +258,7 @@ export const catchTags: {
242
258
  ) => Effect.Effect<any, any, infer A> ? A
243
259
  : never
244
260
  }[keyof Cases]
245
- > => setProto((request) => Effect.catchTags(self(request), cases))
261
+ > => make((request) => Effect.catchTags(self(request), cases))
246
262
  )
247
263
 
248
264
  /** @internal */
@@ -259,7 +275,7 @@ export const catchAll: {
259
275
  <R, E, A, R2, E2, A2>(
260
276
  self: Client.Client<R, E, A>,
261
277
  f: (e: E) => Effect.Effect<R2, E2, A2>
262
- ): Client.Client<R | R2, E2, A2 | A> => setProto((request) => Effect.catchAll(self(request), f))
278
+ ): Client.Client<R | R2, E2, A2 | A> => make((request) => Effect.catchAll(self(request), f))
263
279
  )
264
280
 
265
281
  /** @internal */
@@ -272,7 +288,7 @@ export const filterOrElse = dual<
272
288
  f: Predicate.Predicate<A>,
273
289
  orElse: (a: A) => Effect.Effect<R2, E2, B>
274
290
  ) => Client.Client<R2 | R, E2 | E, A | B>
275
- >(3, (self, f, orElse) => setProto((request) => Effect.filterOrElse(self(request), f, orElse)))
291
+ >(3, (self, f, orElse) => make((request) => Effect.filterOrElse(self(request), f, orElse)))
276
292
 
277
293
  /** @internal */
278
294
  export const filterOrFail = dual<
@@ -284,7 +300,7 @@ export const filterOrFail = dual<
284
300
  f: Predicate.Predicate<A>,
285
301
  orFailWith: (a: A) => E2
286
302
  ) => Client.Client<R, E2 | E, A>
287
- >(3, (self, f, orFailWith) => setProto((request) => Effect.filterOrFail(self(request), f, orFailWith)))
303
+ >(3, (self, f, orFailWith) => make((request) => Effect.filterOrFail(self(request), f, orFailWith)))
288
304
 
289
305
  /** @internal */
290
306
  export const filterStatus = dual<
@@ -298,7 +314,7 @@ export const filterStatus = dual<
298
314
  >(
299
315
  2,
300
316
  (self, f) =>
301
- setProto((request) =>
317
+ make((request) =>
302
318
  Effect.filterOrFail(
303
319
  self(request),
304
320
  (response) => f(response.status),
@@ -327,7 +343,7 @@ export const map = dual<
327
343
  self: Client.Client<R, E, A>,
328
344
  f: (a: A) => B
329
345
  ) => Client.Client<R, E, B>
330
- >(2, (self, f) => setProto((request) => Effect.map(self(request), f)))
346
+ >(2, (self, f) => make((request) => Effect.map(self(request), f)))
331
347
 
332
348
  /** @internal */
333
349
  export const mapEffect = dual<
@@ -338,7 +354,7 @@ export const mapEffect = dual<
338
354
  self: Client.Client<R, E, A>,
339
355
  f: (a: A) => Effect.Effect<R2, E2, B>
340
356
  ) => Client.Client<R | R2, E | E2, B>
341
- >(2, (self, f) => setProto((request) => Effect.flatMap(self(request), f)))
357
+ >(2, (self, f) => make((request) => Effect.flatMap(self(request), f)))
342
358
 
343
359
  /** @internal */
344
360
  export const mapRequest = dual<
@@ -349,7 +365,7 @@ export const mapRequest = dual<
349
365
  self: Client.Client<R, E, A>,
350
366
  f: (a: ClientRequest.ClientRequest) => ClientRequest.ClientRequest
351
367
  ) => Client.Client<R, E, A>
352
- >(2, (self, f) => setProto((request) => self(f(request))))
368
+ >(2, (self, f) => make((request) => self(f(request))))
353
369
 
354
370
  /** @internal */
355
371
  export const mapRequestEffect = dual<
@@ -360,13 +376,13 @@ export const mapRequestEffect = dual<
360
376
  self: Client.Client<R, E, A>,
361
377
  f: (a: ClientRequest.ClientRequest) => Effect.Effect<R2, E2, ClientRequest.ClientRequest>
362
378
  ) => Client.Client<R | R2, E | E2, A>
363
- >(2, (self, f) => setProto((request) => Effect.flatMap(f(request), self)))
379
+ >(2, (self, f) => make((request) => Effect.flatMap(f(request), self)))
364
380
 
365
381
  /** @internal */
366
382
  export const withB3Propagation = <R, E>(
367
383
  self: Client.Client.WithResponse<R, E>
368
384
  ): Client.Client.WithResponse<R | Scope.Scope, E> =>
369
- setProto((req) =>
385
+ make((req) =>
370
386
  pipe(
371
387
  Effect.map(
372
388
  Effect.currentSpan,
@@ -405,7 +421,7 @@ export const retry: {
405
421
  <R, E extends E0, E0, A, R1, B>(
406
422
  self: Client.Client<R, E, A>,
407
423
  policy: Schedule.Schedule<R1, E0, B>
408
- ): Client.Client<R | R1, E, A> => setProto((request) => Effect.retry(self(request), policy))
424
+ ): Client.Client<R | R1, E, A> => make((request) => Effect.retry(self(request), policy))
409
425
  )
410
426
 
411
427
  /** @internal */
@@ -453,7 +469,7 @@ export const tap = dual<
453
469
  self: Client.Client<R, E, A>,
454
470
  f: (a: A) => Effect.Effect<R2, E2, _>
455
471
  ) => Client.Client<R | R2, E | E2, A>
456
- >(2, (self, f) => setProto((request) => Effect.tap(self(request), f)))
472
+ >(2, (self, f) => make((request) => Effect.tap(self(request), f)))
457
473
 
458
474
  /** @internal */
459
475
  export const tapRequest = dual<
@@ -464,4 +480,4 @@ export const tapRequest = dual<
464
480
  self: Client.Client<R, E, A>,
465
481
  f: (a: ClientRequest.ClientRequest) => Effect.Effect<R2, E2, _>
466
482
  ) => Client.Client<R | R2, E | E2, A>
467
- >(2, (self, f) => setProto((request) => Effect.zipRight(f(request), self(request))))
483
+ >(2, (self, f) => make((request) => Effect.zipRight(f(request), self(request))))
@@ -1,5 +1,5 @@
1
- import * as Data from "@effect/data/Data"
2
1
  import type * as Error from "@effect/platform/Http/ClientError"
2
+ import * as Data from "effect/Data"
3
3
 
4
4
  /** @internal */
5
5
  export const TypeId: Error.TypeId = Symbol.for(
@@ -1,6 +1,3 @@
1
- import { dual } from "@effect/data/Function"
2
- import { pipeArguments } from "@effect/data/Pipeable"
3
- import * as Effect from "@effect/io/Effect"
4
1
  import type * as PlatformError from "@effect/platform/Error"
5
2
  import type * as FileSystem from "@effect/platform/FileSystem"
6
3
  import type * as Body from "@effect/platform/Http/Body"
@@ -11,7 +8,10 @@ import type { Method } from "@effect/platform/Http/Method"
11
8
  import * as UrlParams from "@effect/platform/Http/UrlParams"
12
9
  import * as internalBody from "@effect/platform/internal/http/body"
13
10
  import type * as Schema from "@effect/schema/Schema"
14
- import type * as Stream from "@effect/stream/Stream"
11
+ import * as Effect from "effect/Effect"
12
+ import { dual } from "effect/Function"
13
+ import { pipeArguments } from "effect/Pipeable"
14
+ import type * as Stream from "effect/Stream"
15
15
 
16
16
  /** @internal */
17
17
  export const TypeId: ClientRequest.TypeId = Symbol.for("@effect/platform/Http/ClientRequest") as ClientRequest.TypeId
@@ -1,5 +1,3 @@
1
- import * as Option from "@effect/data/Option"
2
- import * as Effect from "@effect/io/Effect"
3
1
  import type * as Error from "@effect/platform/Http/ClientError"
4
2
  import type * as ClientRequest from "@effect/platform/Http/ClientRequest"
5
3
  import type * as ClientResponse from "@effect/platform/Http/ClientResponse"
@@ -9,7 +7,9 @@ import * as UrlParams from "@effect/platform/Http/UrlParams"
9
7
  import * as internalError from "@effect/platform/internal/http/clientError"
10
8
  import type * as ParseResult from "@effect/schema/ParseResult"
11
9
  import * as Schema from "@effect/schema/Schema"
12
- import * as Stream from "@effect/stream/Stream"
10
+ import * as Effect from "effect/Effect"
11
+ import * as Option from "effect/Option"
12
+ import * as Stream from "effect/Stream"
13
13
 
14
14
  /** @internal */
15
15
  export const TypeId: ClientResponse.TypeId = Symbol.for("@effect/platform/Http/ClientResponse") as ClientResponse.TypeId
@@ -1,5 +1,5 @@
1
- import * as Context from "@effect/data/Context"
2
1
  import type * as Etag from "@effect/platform/Http/Etag"
2
+ import * as Context from "effect/Context"
3
3
 
4
4
  /** @internal */
5
5
  export const GeneratorTypeId: Etag.GeneratorTypeId = Symbol.for(
@@ -1,16 +1,16 @@
1
- import * as Chunk from "@effect/data/Chunk"
2
- import * as Data from "@effect/data/Data"
3
- import { dual, pipe } from "@effect/data/Function"
4
- import { globalValue } from "@effect/data/GlobalValue"
5
- import * as Option from "@effect/data/Option"
6
- import * as Predicate from "@effect/data/Predicate"
7
- import * as ReadonlyArray from "@effect/data/ReadonlyArray"
8
- import * as Effect from "@effect/io/Effect"
9
- import * as FiberRef from "@effect/io/FiberRef"
10
1
  import * as FileSystem from "@effect/platform/FileSystem"
11
2
  import type * as FormData from "@effect/platform/Http/FormData"
12
3
  import type * as ParseResult from "@effect/schema/ParseResult"
13
4
  import * as Schema from "@effect/schema/Schema"
5
+ import * as Chunk from "effect/Chunk"
6
+ import * as Data from "effect/Data"
7
+ import * as Effect from "effect/Effect"
8
+ import * as FiberRef from "effect/FiberRef"
9
+ import { dual, pipe } from "effect/Function"
10
+ import { globalValue } from "effect/GlobalValue"
11
+ import * as Option from "effect/Option"
12
+ import * as Predicate from "effect/Predicate"
13
+ import * as ReadonlyArray from "effect/ReadonlyArray"
14
14
 
15
15
  /** @internal */
16
16
  export const TypeId: FormData.TypeId = Symbol.for("@effect/platform/Http/FormData") as FormData.TypeId
@@ -1,10 +1,10 @@
1
- import { flow } from "@effect/data/Function"
2
- import * as Effect from "@effect/io/Effect"
3
1
  import * as Headers from "@effect/platform/Http/Headers"
4
2
  import * as IncomingMessage from "@effect/platform/Http/IncomingMessage"
5
3
  import type * as Middleware from "@effect/platform/Http/Middleware"
6
4
  import * as ServerRequest from "@effect/platform/Http/ServerRequest"
7
5
  import * as ServerResponse from "@effect/platform/Http/ServerResponse"
6
+ import * as Effect from "effect/Effect"
7
+ import { flow } from "effect/Function"
8
8
 
9
9
  /** @internal */
10
10
  export const make = <M extends Middleware.Middleware>(middleware: M): M => middleware
@@ -1,11 +1,11 @@
1
- import * as Context from "@effect/data/Context"
2
- import { pipe } from "@effect/data/Function"
3
- import * as Effect from "@effect/io/Effect"
4
1
  import * as FileSystem from "@effect/platform/FileSystem"
5
2
  import type * as Body from "@effect/platform/Http/Body"
6
3
  import * as Etag from "@effect/platform/Http/Etag"
7
4
  import type * as Platform from "@effect/platform/Http/Platform"
8
5
  import type * as ServerResponse from "@effect/platform/Http/ServerResponse"
6
+ import * as Context from "effect/Context"
7
+ import * as Effect from "effect/Effect"
8
+ import { pipe } from "effect/Function"
9
9
 
10
10
  /** @internal */
11
11
  export const TypeId: Platform.TypeId = Symbol.for("@effect/platform/Http/Platform") as Platform.TypeId
@@ -1,13 +1,3 @@
1
- import * as Chunk from "@effect/data/Chunk"
2
- import * as Context from "@effect/data/Context"
3
- import * as Equal from "@effect/data/Equal"
4
- import { dual } from "@effect/data/Function"
5
- import * as Hash from "@effect/data/Hash"
6
- import * as Inspectable from "@effect/data/Inspectable"
7
- import * as Option from "@effect/data/Option"
8
- import { pipeArguments } from "@effect/data/Pipeable"
9
- import type * as Cause from "@effect/io/Cause"
10
- import * as Effect from "@effect/io/Effect"
11
1
  import type * as App from "@effect/platform/Http/App"
12
2
  import type * as Method from "@effect/platform/Http/Method"
13
3
  import type * as Router from "@effect/platform/Http/Router"
@@ -15,9 +5,14 @@ import * as Error from "@effect/platform/Http/ServerError"
15
5
  import * as ServerRequest from "@effect/platform/Http/ServerRequest"
16
6
  import type * as ServerResponse from "@effect/platform/Http/ServerResponse"
17
7
  import * as Schema from "@effect/schema/Schema"
18
- import * as Channel from "@effect/stream/Channel"
19
- import * as Sink from "@effect/stream/Sink"
20
- import * as Stream from "@effect/stream/Stream"
8
+ import type * as Cause from "effect/Cause"
9
+ import * as Chunk from "effect/Chunk"
10
+ import * as Context from "effect/Context"
11
+ import * as Effect from "effect/Effect"
12
+ import * as Effectable from "effect/Effectable"
13
+ import { dual } from "effect/Function"
14
+ import * as Inspectable from "effect/Inspectable"
15
+ import * as Option from "effect/Option"
21
16
  import type { HTTPMethod } from "find-my-way"
22
17
  import FindMyWay from "find-my-way"
23
18
 
@@ -54,43 +49,27 @@ export const schemaParams = <I extends Readonly<Record<string, string>>, A>(sche
54
49
  )
55
50
  }
56
51
 
57
- class RouterImpl<R, E> implements Router.Router<R, E> {
52
+ class RouterImpl<R, E> extends Effectable.Effectable<
53
+ Exclude<R, Router.RouteContext>,
54
+ E | Error.RouteNotFound,
55
+ ServerResponse.ServerResponse
56
+ > implements Router.Router<R, E> {
58
57
  readonly [TypeId]: Router.TypeId
59
58
  constructor(
60
59
  readonly routes: Chunk.Chunk<Router.Route<R, E>>,
61
60
  readonly mounts: Chunk.Chunk<readonly [string, App.Default<R, E>]>
62
61
  ) {
62
+ super()
63
63
  this[TypeId] = TypeId
64
- this[Effect.EffectTypeId] = undefined
65
- this[Stream.StreamTypeId] = undefined
66
- this[Sink.SinkTypeId] = undefined
67
- this[Channel.ChannelTypeId] = undefined
68
64
  }
69
- pipe() {
70
- return pipeArguments(this, arguments)
71
- }
72
- private httpApp: App.Default<Router.Router.ExcludeProvided<R>, E | Error.RouteNotFound> | undefined
65
+ private httpApp:
66
+ | Effect.Effect<Exclude<R, Router.RouteContext>, E | Error.RouteNotFound, ServerResponse.ServerResponse>
67
+ | undefined
73
68
  commit() {
74
69
  if (this.httpApp === undefined) {
75
- this.httpApp = toHttpApp(this)
70
+ this.httpApp = toHttpApp(this) as any
76
71
  }
77
- return this.httpApp
78
- }
79
-
80
- // implements HttpApp/Effect
81
- public _tag = "Commit" // OP_COMMIT
82
- readonly [Effect.EffectTypeId]: any
83
- readonly [Stream.StreamTypeId]: any
84
- readonly [Sink.SinkTypeId]: any
85
- readonly [Channel.ChannelTypeId]: any;
86
- [Equal.symbol](
87
- this: RouterImpl<R, E>,
88
- that: RouterImpl<R, E>
89
- ): boolean {
90
- return this === that
91
- }
92
- [Hash.symbol](this: RouterImpl<R, E>): number {
93
- return Hash.random(this)
72
+ return this.httpApp!
94
73
  }
95
74
  toJSON() {
96
75
  return {
@@ -1,12 +1,12 @@
1
- import * as Context from "@effect/data/Context"
2
- import { dual } from "@effect/data/Function"
3
- import * as Effect from "@effect/io/Effect"
4
- import type * as Scope from "@effect/io/Scope"
5
1
  import type * as App from "@effect/platform/Http/App"
6
2
  import type * as Middleware from "@effect/platform/Http/Middleware"
7
3
  import type * as Server from "@effect/platform/Http/Server"
8
4
  import type * as Error from "@effect/platform/Http/ServerError"
9
5
  import type * as ServerRequest from "@effect/platform/Http/ServerRequest"
6
+ import * as Context from "effect/Context"
7
+ import * as Effect from "effect/Effect"
8
+ import { dual } from "effect/Function"
9
+ import type * as Scope from "effect/Scope"
10
10
 
11
11
  /** @internal */
12
12
  export const TypeId: Server.TypeId = Symbol.for("@effect/platform/Http/Server") as Server.TypeId
@@ -1,5 +1,5 @@
1
- import * as Data from "@effect/data/Data"
2
1
  import type * as Error from "@effect/platform/Http/ServerError"
2
+ import * as Data from "effect/Data"
3
3
 
4
4
  /** @internal */
5
5
  export const TypeId: Error.TypeId = Symbol.for(