effect 4.0.0-beta.72 → 4.0.0-beta.74

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 (361) hide show
  1. package/dist/Array.d.ts +16 -16
  2. package/dist/Array.js +4 -4
  3. package/dist/Boolean.d.ts +2 -2
  4. package/dist/Boolean.js +2 -2
  5. package/dist/Channel.d.ts +63 -63
  6. package/dist/Channel.js +25 -25
  7. package/dist/Chunk.d.ts +17 -17
  8. package/dist/Chunk.js +5 -5
  9. package/dist/Context.d.ts +3 -3
  10. package/dist/Context.js +1 -1
  11. package/dist/Cron.d.ts +4 -4
  12. package/dist/Cron.js +4 -4
  13. package/dist/Deferred.d.ts +37 -37
  14. package/dist/Deferred.js +13 -13
  15. package/dist/Duration.d.ts +6 -6
  16. package/dist/Duration.js +2 -2
  17. package/dist/Effect.d.ts +58 -58
  18. package/dist/Effect.js +39 -39
  19. package/dist/Equal.d.ts +2 -2
  20. package/dist/Equal.js +2 -2
  21. package/dist/Equivalence.d.ts +1 -1
  22. package/dist/Equivalence.js +1 -1
  23. package/dist/ExecutionPlan.d.ts +2 -2
  24. package/dist/ExecutionPlan.js +1 -1
  25. package/dist/FileSystem.d.ts +6 -6
  26. package/dist/FileSystem.js +2 -2
  27. package/dist/Function.d.ts +5 -5
  28. package/dist/Function.js +5 -5
  29. package/dist/Graph.d.ts +11 -11
  30. package/dist/Graph.js +5 -5
  31. package/dist/HKT.d.ts +1 -1
  32. package/dist/HashMap.d.ts +3 -3
  33. package/dist/HashSet.d.ts +1 -1
  34. package/dist/Iterable.d.ts +15 -15
  35. package/dist/Iterable.js +5 -5
  36. package/dist/Layer.d.ts +16 -16
  37. package/dist/Layer.js +5 -5
  38. package/dist/Logger.d.ts +5 -5
  39. package/dist/Logger.js +4 -4
  40. package/dist/ManagedRuntime.d.ts +2 -2
  41. package/dist/Match.d.ts +20 -20
  42. package/dist/Match.js +16 -16
  43. package/dist/Metric.d.ts +16 -16
  44. package/dist/Metric.js +3 -3
  45. package/dist/Option.d.ts +36 -36
  46. package/dist/Option.js +17 -17
  47. package/dist/Order.d.ts +1 -1
  48. package/dist/Order.js +1 -1
  49. package/dist/Path.d.ts +1 -1
  50. package/dist/Path.js +1 -1
  51. package/dist/Pipeable.d.ts +1 -1
  52. package/dist/Pipeable.js +1 -1
  53. package/dist/Predicate.d.ts +5 -5
  54. package/dist/PubSub.d.ts +9 -9
  55. package/dist/PubSub.js +5 -5
  56. package/dist/Queue.d.ts +24 -24
  57. package/dist/Queue.js +20 -20
  58. package/dist/Record.d.ts +15 -15
  59. package/dist/Record.js +5 -5
  60. package/dist/Redacted.d.ts +2 -2
  61. package/dist/Redacted.js +1 -1
  62. package/dist/Ref.d.ts +6 -6
  63. package/dist/Ref.js +6 -6
  64. package/dist/RegExp.d.ts +1 -1
  65. package/dist/RegExp.js +1 -1
  66. package/dist/Request.d.ts +4 -4
  67. package/dist/RequestResolver.d.ts +6 -6
  68. package/dist/RequestResolver.js +2 -2
  69. package/dist/Resource.d.ts +1 -1
  70. package/dist/Resource.js +1 -1
  71. package/dist/Result.d.ts +18 -18
  72. package/dist/Result.js +11 -11
  73. package/dist/Schedule.d.ts +44 -44
  74. package/dist/Schedule.js +18 -18
  75. package/dist/Schema.d.ts +177 -459
  76. package/dist/Schema.d.ts.map +1 -1
  77. package/dist/Schema.js +25 -25
  78. package/dist/Schema.js.map +1 -1
  79. package/dist/SchemaAST.d.ts +1 -1
  80. package/dist/SchemaGetter.d.ts +13 -13
  81. package/dist/SchemaGetter.js +12 -12
  82. package/dist/SchemaParser.d.ts +3 -3
  83. package/dist/SchemaParser.js +3 -3
  84. package/dist/Scope.d.ts +1 -1
  85. package/dist/Scope.js +1 -1
  86. package/dist/Sink.d.ts +5 -5
  87. package/dist/Sink.js +3 -3
  88. package/dist/Stream.d.ts +55 -55
  89. package/dist/Stream.js +21 -21
  90. package/dist/String.d.ts +5 -5
  91. package/dist/String.js +3 -3
  92. package/dist/Struct.d.ts +8 -8
  93. package/dist/Struct.js +3 -3
  94. package/dist/SynchronizedRef.d.ts +57 -57
  95. package/dist/SynchronizedRef.js +19 -19
  96. package/dist/Terminal.d.ts +1 -1
  97. package/dist/Terminal.js +1 -1
  98. package/dist/Tracer.d.ts +5 -5
  99. package/dist/Tracer.js +2 -2
  100. package/dist/Tuple.d.ts +14 -14
  101. package/dist/Tuple.js +6 -6
  102. package/dist/TxHashMap.d.ts +3 -3
  103. package/dist/TxHashSet.d.ts +1 -1
  104. package/dist/Unify.d.ts +7 -7
  105. package/dist/Unify.js +1 -1
  106. package/dist/testing/TestClock.d.ts +5 -5
  107. package/dist/testing/TestClock.js +4 -4
  108. package/dist/testing/TestConsole.d.ts +3 -3
  109. package/dist/testing/TestConsole.js +3 -3
  110. package/dist/unstable/ai/Chat.d.ts +2 -2
  111. package/dist/unstable/ai/Chat.js +2 -2
  112. package/dist/unstable/ai/EmbeddingModel.d.ts +1 -1
  113. package/dist/unstable/ai/IdGenerator.d.ts +2 -2
  114. package/dist/unstable/ai/IdGenerator.js +1 -1
  115. package/dist/unstable/ai/LanguageModel.d.ts +4 -4
  116. package/dist/unstable/ai/LanguageModel.js +1 -1
  117. package/dist/unstable/ai/Prompt.d.ts +15 -15
  118. package/dist/unstable/ai/Prompt.js +1 -1
  119. package/dist/unstable/ai/Telemetry.d.ts +5 -5
  120. package/dist/unstable/ai/Telemetry.js +2 -2
  121. package/dist/unstable/ai/Tokenizer.d.ts +1 -1
  122. package/dist/unstable/ai/Tokenizer.js +1 -1
  123. package/dist/unstable/ai/Tool.d.ts +6 -6
  124. package/dist/unstable/ai/Tool.js +6 -6
  125. package/dist/unstable/cli/Command.d.ts.map +1 -1
  126. package/dist/unstable/cli/Command.js +1 -1
  127. package/dist/unstable/cli/Command.js.map +1 -1
  128. package/dist/unstable/cli/Param.d.ts +1 -1
  129. package/dist/unstable/cli/Primitive.d.ts +3 -3
  130. package/dist/unstable/cli/Primitive.js +1 -1
  131. package/dist/unstable/cli/Prompt.d.ts +11 -11
  132. package/dist/unstable/cli/internal/parser.js +145 -10
  133. package/dist/unstable/cli/internal/parser.js.map +1 -1
  134. package/dist/unstable/cluster/Entity.d.ts +1 -1
  135. package/dist/unstable/cluster/Entity.js +1 -1
  136. package/dist/unstable/cluster/EntityResource.d.ts +1 -0
  137. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  138. package/dist/unstable/cluster/EntityResource.js +5 -3
  139. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  140. package/dist/unstable/cluster/HttpRunner.d.ts +2 -2
  141. package/dist/unstable/cluster/HttpRunner.js +2 -2
  142. package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
  143. package/dist/unstable/cluster/K8sHttpClient.js +1 -1
  144. package/dist/unstable/cluster/Runners.d.ts +1 -1
  145. package/dist/unstable/cluster/Runners.js +1 -1
  146. package/dist/unstable/cluster/Sharding.d.ts +1 -1
  147. package/dist/unstable/cluster/Sharding.js +1 -1
  148. package/dist/unstable/cluster/SingletonAddress.d.ts +1 -1
  149. package/dist/unstable/cluster/SingletonAddress.js +1 -1
  150. package/dist/unstable/cluster/Snowflake.d.ts +5 -5
  151. package/dist/unstable/cluster/Snowflake.js +5 -5
  152. package/dist/unstable/devtools/DevToolsClient.d.ts +1 -1
  153. package/dist/unstable/devtools/DevToolsClient.js +1 -1
  154. package/dist/unstable/eventlog/EventLog.d.ts +1 -1
  155. package/dist/unstable/eventlog/EventLog.js +1 -1
  156. package/dist/unstable/eventlog/EventLogEncryption.d.ts +1 -1
  157. package/dist/unstable/eventlog/EventLogEncryption.js +1 -1
  158. package/dist/unstable/eventlog/EventLogRemote.d.ts +1 -1
  159. package/dist/unstable/eventlog/EventLogRemote.js +1 -1
  160. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +3 -3
  161. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +3 -3
  162. package/dist/unstable/http/Cookies.d.ts +1 -1
  163. package/dist/unstable/http/Etag.d.ts +1 -1
  164. package/dist/unstable/http/Etag.js +1 -1
  165. package/dist/unstable/http/FetchHttpClient.d.ts +2 -2
  166. package/dist/unstable/http/FetchHttpClient.js +2 -2
  167. package/dist/unstable/http/HttpClient.d.ts +1 -1
  168. package/dist/unstable/http/HttpClient.js +1 -1
  169. package/dist/unstable/http/HttpClientRequest.d.ts +2 -2
  170. package/dist/unstable/http/HttpMiddleware.d.ts +1 -1
  171. package/dist/unstable/http/HttpMiddleware.js +1 -1
  172. package/dist/unstable/http/HttpPlatform.d.ts +1 -1
  173. package/dist/unstable/http/HttpPlatform.js +1 -1
  174. package/dist/unstable/http/HttpRouter.d.ts +4 -4
  175. package/dist/unstable/http/HttpRouter.js +4 -4
  176. package/dist/unstable/http/HttpServerResponse.d.ts +3 -3
  177. package/dist/unstable/http/Url.d.ts +33 -33
  178. package/dist/unstable/http/Url.js +11 -11
  179. package/dist/unstable/httpapi/HttpApi.d.ts +1 -1
  180. package/dist/unstable/httpapi/HttpApi.js +1 -1
  181. package/dist/unstable/httpapi/HttpApiBuilder.js +2 -3
  182. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  183. package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
  184. package/dist/unstable/httpapi/HttpApiError.js +13 -13
  185. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +27 -5
  186. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  187. package/dist/unstable/httpapi/HttpApiSecurity.js +26 -3
  188. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  189. package/dist/unstable/httpapi/OpenApi.js +2 -2
  190. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  191. package/dist/unstable/observability/PrometheusMetrics.d.ts +4 -4
  192. package/dist/unstable/observability/PrometheusMetrics.js +2 -2
  193. package/dist/unstable/persistence/KeyValueStore.d.ts +3 -3
  194. package/dist/unstable/persistence/KeyValueStore.js +1 -1
  195. package/dist/unstable/persistence/Persistable.d.ts +2 -2
  196. package/dist/unstable/persistence/Persistable.js +2 -2
  197. package/dist/unstable/persistence/PersistedQueue.d.ts +8 -8
  198. package/dist/unstable/persistence/PersistedQueue.js +8 -8
  199. package/dist/unstable/persistence/RateLimiter.d.ts +1 -1
  200. package/dist/unstable/persistence/RateLimiter.js +1 -1
  201. package/dist/unstable/process/ChildProcess.d.ts +5 -5
  202. package/dist/unstable/process/ChildProcess.js +2 -2
  203. package/dist/unstable/reactivity/AsyncResult.d.ts +4 -4
  204. package/dist/unstable/reactivity/AsyncResult.js +1 -1
  205. package/dist/unstable/reactivity/Atom.d.ts +1 -1
  206. package/dist/unstable/reactivity/Atom.js +1 -1
  207. package/dist/unstable/reactivity/AtomRegistry.d.ts +1 -1
  208. package/dist/unstable/reactivity/AtomRegistry.js +1 -1
  209. package/dist/unstable/reactivity/Reactivity.d.ts +1 -1
  210. package/dist/unstable/reactivity/Reactivity.js +1 -1
  211. package/dist/unstable/rpc/Rpc.d.ts +5 -5
  212. package/dist/unstable/rpc/Rpc.js +1 -1
  213. package/dist/unstable/rpc/RpcMiddleware.d.ts +1 -1
  214. package/dist/unstable/rpc/RpcMiddleware.js +1 -1
  215. package/dist/unstable/rpc/RpcSchema.d.ts +3 -3
  216. package/dist/unstable/rpc/RpcSchema.js +2 -2
  217. package/dist/unstable/schema/Model.d.ts +2 -2
  218. package/dist/unstable/schema/Model.js +1 -1
  219. package/dist/unstable/socket/Socket.d.ts +3 -3
  220. package/dist/unstable/socket/Socket.js +3 -3
  221. package/dist/unstable/socket/SocketServer.d.ts +1 -1
  222. package/dist/unstable/socket/SocketServer.js +1 -1
  223. package/dist/unstable/sql/Migrator.d.ts +1 -1
  224. package/dist/unstable/sql/SqlClient.d.ts +3 -3
  225. package/dist/unstable/sql/SqlClient.js +2 -2
  226. package/dist/unstable/sql/SqlConnection.d.ts +1 -1
  227. package/dist/unstable/sql/SqlConnection.js +1 -1
  228. package/dist/unstable/sql/Statement.d.ts +2 -2
  229. package/dist/unstable/sql/Statement.js +2 -2
  230. package/dist/unstable/workers/Transferable.d.ts +1 -1
  231. package/dist/unstable/workers/Transferable.js +1 -1
  232. package/dist/unstable/workers/Worker.d.ts +1 -1
  233. package/dist/unstable/workers/Worker.js +1 -1
  234. package/dist/unstable/workflow/Activity.d.ts +1 -1
  235. package/dist/unstable/workflow/Activity.js +1 -1
  236. package/dist/unstable/workflow/DurableDeferred.d.ts +1 -1
  237. package/dist/unstable/workflow/DurableDeferred.js +1 -1
  238. package/package.json +1 -1
  239. package/src/Array.ts +16 -16
  240. package/src/Boolean.ts +2 -2
  241. package/src/Channel.ts +67 -67
  242. package/src/Chunk.ts +18 -18
  243. package/src/Context.ts +4 -4
  244. package/src/Cron.ts +4 -4
  245. package/src/Deferred.ts +37 -37
  246. package/src/Duration.ts +6 -6
  247. package/src/Effect.ts +58 -58
  248. package/src/Equal.ts +2 -2
  249. package/src/Equivalence.ts +1 -1
  250. package/src/ExecutionPlan.ts +2 -2
  251. package/src/FileSystem.ts +6 -6
  252. package/src/Function.ts +5 -5
  253. package/src/Graph.ts +11 -11
  254. package/src/HKT.ts +1 -1
  255. package/src/HashMap.ts +3 -3
  256. package/src/HashSet.ts +1 -1
  257. package/src/Iterable.ts +15 -15
  258. package/src/Layer.ts +16 -16
  259. package/src/Logger.ts +7 -7
  260. package/src/ManagedRuntime.ts +2 -2
  261. package/src/Match.ts +20 -20
  262. package/src/Metric.ts +20 -20
  263. package/src/Option.ts +36 -36
  264. package/src/Order.ts +1 -1
  265. package/src/Path.ts +1 -1
  266. package/src/Pipeable.ts +1 -1
  267. package/src/Predicate.ts +5 -5
  268. package/src/PubSub.ts +9 -9
  269. package/src/Queue.ts +24 -24
  270. package/src/Record.ts +15 -15
  271. package/src/Redacted.ts +2 -2
  272. package/src/Ref.ts +18 -18
  273. package/src/RegExp.ts +1 -1
  274. package/src/Request.ts +4 -4
  275. package/src/RequestResolver.ts +8 -8
  276. package/src/Resource.ts +1 -1
  277. package/src/Result.ts +18 -18
  278. package/src/Schedule.ts +45 -45
  279. package/src/Schema.ts +177 -459
  280. package/src/SchemaAST.ts +1 -1
  281. package/src/SchemaGetter.ts +13 -13
  282. package/src/SchemaParser.ts +3 -3
  283. package/src/Scope.ts +1 -1
  284. package/src/Sink.ts +5 -5
  285. package/src/Stream.ts +57 -57
  286. package/src/String.ts +5 -5
  287. package/src/Struct.ts +8 -8
  288. package/src/SynchronizedRef.ts +57 -57
  289. package/src/Terminal.ts +1 -1
  290. package/src/Tracer.ts +5 -5
  291. package/src/Tuple.ts +14 -14
  292. package/src/TxHashMap.ts +3 -3
  293. package/src/TxHashSet.ts +1 -1
  294. package/src/Unify.ts +7 -7
  295. package/src/testing/TestClock.ts +5 -5
  296. package/src/testing/TestConsole.ts +3 -3
  297. package/src/unstable/ai/Chat.ts +2 -2
  298. package/src/unstable/ai/EmbeddingModel.ts +1 -1
  299. package/src/unstable/ai/IdGenerator.ts +2 -2
  300. package/src/unstable/ai/LanguageModel.ts +4 -4
  301. package/src/unstable/ai/Prompt.ts +15 -15
  302. package/src/unstable/ai/Telemetry.ts +5 -5
  303. package/src/unstable/ai/Tokenizer.ts +1 -1
  304. package/src/unstable/ai/Tool.ts +6 -6
  305. package/src/unstable/cli/Command.ts +5 -1
  306. package/src/unstable/cli/Param.ts +1 -1
  307. package/src/unstable/cli/Primitive.ts +3 -3
  308. package/src/unstable/cli/Prompt.ts +11 -11
  309. package/src/unstable/cli/internal/parser.ts +204 -10
  310. package/src/unstable/cluster/Entity.ts +1 -1
  311. package/src/unstable/cluster/EntityResource.ts +8 -4
  312. package/src/unstable/cluster/HttpRunner.ts +2 -2
  313. package/src/unstable/cluster/K8sHttpClient.ts +1 -1
  314. package/src/unstable/cluster/Runners.ts +1 -1
  315. package/src/unstable/cluster/Sharding.ts +1 -1
  316. package/src/unstable/cluster/SingletonAddress.ts +1 -1
  317. package/src/unstable/cluster/Snowflake.ts +5 -5
  318. package/src/unstable/devtools/DevToolsClient.ts +1 -1
  319. package/src/unstable/eventlog/EventLog.ts +1 -1
  320. package/src/unstable/eventlog/EventLogEncryption.ts +1 -1
  321. package/src/unstable/eventlog/EventLogRemote.ts +1 -1
  322. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +3 -3
  323. package/src/unstable/http/Cookies.ts +1 -1
  324. package/src/unstable/http/Etag.ts +1 -1
  325. package/src/unstable/http/FetchHttpClient.ts +2 -2
  326. package/src/unstable/http/HttpClient.ts +1 -1
  327. package/src/unstable/http/HttpClientRequest.ts +2 -2
  328. package/src/unstable/http/HttpMiddleware.ts +1 -1
  329. package/src/unstable/http/HttpPlatform.ts +1 -1
  330. package/src/unstable/http/HttpRouter.ts +4 -4
  331. package/src/unstable/http/HttpServerResponse.ts +3 -3
  332. package/src/unstable/http/Url.ts +33 -33
  333. package/src/unstable/httpapi/HttpApi.ts +1 -1
  334. package/src/unstable/httpapi/HttpApiBuilder.ts +2 -3
  335. package/src/unstable/httpapi/HttpApiError.ts +13 -13
  336. package/src/unstable/httpapi/HttpApiSecurity.ts +36 -8
  337. package/src/unstable/httpapi/OpenApi.ts +2 -2
  338. package/src/unstable/observability/PrometheusMetrics.ts +4 -4
  339. package/src/unstable/persistence/KeyValueStore.ts +3 -3
  340. package/src/unstable/persistence/Persistable.ts +2 -2
  341. package/src/unstable/persistence/PersistedQueue.ts +8 -8
  342. package/src/unstable/persistence/RateLimiter.ts +1 -1
  343. package/src/unstable/process/ChildProcess.ts +5 -5
  344. package/src/unstable/reactivity/AsyncResult.ts +4 -4
  345. package/src/unstable/reactivity/Atom.ts +1 -1
  346. package/src/unstable/reactivity/AtomRegistry.ts +1 -1
  347. package/src/unstable/reactivity/Reactivity.ts +1 -1
  348. package/src/unstable/rpc/Rpc.ts +5 -5
  349. package/src/unstable/rpc/RpcMiddleware.ts +1 -1
  350. package/src/unstable/rpc/RpcSchema.ts +3 -3
  351. package/src/unstable/schema/Model.ts +2 -2
  352. package/src/unstable/socket/Socket.ts +3 -3
  353. package/src/unstable/socket/SocketServer.ts +1 -1
  354. package/src/unstable/sql/Migrator.ts +1 -1
  355. package/src/unstable/sql/SqlClient.ts +3 -3
  356. package/src/unstable/sql/SqlConnection.ts +1 -1
  357. package/src/unstable/sql/Statement.ts +2 -2
  358. package/src/unstable/workers/Transferable.ts +1 -1
  359. package/src/unstable/workers/Worker.ts +1 -1
  360. package/src/unstable/workflow/Activity.ts +1 -1
  361. package/src/unstable/workflow/DurableDeferred.ts +1 -1
@@ -302,7 +302,7 @@ export const RouterConfig = Context.Reference<Partial<FindMyWay.RouterConfig>>(
302
302
  * It provides the route definition and the path parameters captured by the route
303
303
  * matcher.
304
304
  *
305
- * @category route context
305
+ * @category services
306
306
  * @since 4.0.0
307
307
  */
308
308
  export class RouteContext extends Context.Service<RouteContext, {
@@ -313,7 +313,7 @@ export class RouteContext extends Context.Service<RouteContext, {
313
313
  /**
314
314
  * Effect that returns the path parameters captured for the current matched route.
315
315
  *
316
- * @category RouteContext
316
+ * @category getters
317
317
  * @since 4.0.0
318
318
  */
319
319
  export const params: Effect.Effect<
@@ -1293,7 +1293,7 @@ export const provideRequest =
1293
1293
  /**
1294
1294
  * Runs the provided application layer as an HTTP server.
1295
1295
  *
1296
- * @category Server
1296
+ * @category server
1297
1297
  * @since 4.0.0
1298
1298
  */
1299
1299
  export const serve = <A, E, R, HE, HR = Request.Only<"Requires", R> | Request.Only<"GlobalRequires", R>>(
@@ -1357,7 +1357,7 @@ export const serve = <A, E, R, HE, HR = Request.Only<"Requires", R> | Request.On
1357
1357
  * Web `Response` values and a `dispose` function for releasing the layer
1358
1358
  * resources.
1359
1359
  *
1360
- * @category Server
1360
+ * @category server
1361
1361
  * @since 4.0.0
1362
1362
  */
1363
1363
  export const toWebHandler = <
@@ -95,7 +95,7 @@ export interface HttpServerResponse extends Inspectable.Inspectable, Pipeable, E
95
95
  /**
96
96
  * Common options accepted by HTTP server response constructors.
97
97
  *
98
- * @category models
98
+ * @category options
99
99
  * @since 4.0.0
100
100
  */
101
101
  export interface Options {
@@ -118,7 +118,7 @@ export declare namespace Options {
118
118
  * Response options for constructors whose body determines its own content type
119
119
  * and content length.
120
120
  *
121
- * @category models
121
+ * @category options
122
122
  * @since 4.0.0
123
123
  */
124
124
  export interface WithContent extends Omit<Options, "contentType" | "contentLength"> {}
@@ -127,7 +127,7 @@ export declare namespace Options {
127
127
  * Response options for constructors that allow overriding the content type while
128
128
  * deriving the content length from the body.
129
129
  *
130
- * @category models
130
+ * @category options
131
131
  * @since 4.0.0
132
132
  */
133
133
  export interface WithContentType extends Omit<Options, "contentLength"> {}
@@ -234,21 +234,21 @@ const immutableURLSetter = <P extends keyof URL, A = never>(property: P): {
234
234
  /**
235
235
  * Updates the hash fragment of the URL.
236
236
  *
237
- * @category Setters
237
+ * @category setters
238
238
  * @since 4.0.0
239
239
  */
240
240
  export const setHash: {
241
241
  /**
242
242
  * Updates the hash fragment of the URL.
243
243
  *
244
- * @category Setters
244
+ * @category setters
245
245
  * @since 4.0.0
246
246
  */
247
247
  (hash: string): (url: URL) => URL
248
248
  /**
249
249
  * Updates the hash fragment of the URL.
250
250
  *
251
- * @category Setters
251
+ * @category setters
252
252
  * @since 4.0.0
253
253
  */
254
254
  (url: URL, hash: string): URL
@@ -257,21 +257,21 @@ export const setHash: {
257
257
  /**
258
258
  * Updates the host (domain and port) of the URL.
259
259
  *
260
- * @category Setters
260
+ * @category setters
261
261
  * @since 4.0.0
262
262
  */
263
263
  export const setHost: {
264
264
  /**
265
265
  * Updates the host (domain and port) of the URL.
266
266
  *
267
- * @category Setters
267
+ * @category setters
268
268
  * @since 4.0.0
269
269
  */
270
270
  (host: string): (url: URL) => URL
271
271
  /**
272
272
  * Updates the host (domain and port) of the URL.
273
273
  *
274
- * @category Setters
274
+ * @category setters
275
275
  * @since 4.0.0
276
276
  */
277
277
  (url: URL, host: string): URL
@@ -280,21 +280,21 @@ export const setHost: {
280
280
  /**
281
281
  * Updates the domain of the URL without modifying the port.
282
282
  *
283
- * @category Setters
283
+ * @category setters
284
284
  * @since 4.0.0
285
285
  */
286
286
  export const setHostname: {
287
287
  /**
288
288
  * Updates the domain of the URL without modifying the port.
289
289
  *
290
- * @category Setters
290
+ * @category setters
291
291
  * @since 4.0.0
292
292
  */
293
293
  (hostname: string): (url: URL) => URL
294
294
  /**
295
295
  * Updates the domain of the URL without modifying the port.
296
296
  *
297
- * @category Setters
297
+ * @category setters
298
298
  * @since 4.0.0
299
299
  */
300
300
  (url: URL, hostname: string): URL
@@ -303,21 +303,21 @@ export const setHostname: {
303
303
  /**
304
304
  * Replaces the entire URL string.
305
305
  *
306
- * @category Setters
306
+ * @category setters
307
307
  * @since 4.0.0
308
308
  */
309
309
  export const setHref: {
310
310
  /**
311
311
  * Replaces the entire URL string.
312
312
  *
313
- * @category Setters
313
+ * @category setters
314
314
  * @since 4.0.0
315
315
  */
316
316
  (href: string): (url: URL) => URL
317
317
  /**
318
318
  * Replaces the entire URL string.
319
319
  *
320
- * @category Setters
320
+ * @category setters
321
321
  * @since 4.0.0
322
322
  */
323
323
  (url: URL, href: string): URL
@@ -326,21 +326,21 @@ export const setHref: {
326
326
  /**
327
327
  * Updates the password used for authentication.
328
328
  *
329
- * @category Setters
329
+ * @category setters
330
330
  * @since 4.0.0
331
331
  */
332
332
  export const setPassword: {
333
333
  /**
334
334
  * Updates the password used for authentication.
335
335
  *
336
- * @category Setters
336
+ * @category setters
337
337
  * @since 4.0.0
338
338
  */
339
339
  (password: string | Redacted.Redacted): (url: URL) => URL
340
340
  /**
341
341
  * Updates the password used for authentication.
342
342
  *
343
- * @category Setters
343
+ * @category setters
344
344
  * @since 4.0.0
345
345
  */
346
346
  (url: URL, password: string | Redacted.Redacted): URL
@@ -354,21 +354,21 @@ export const setPassword: {
354
354
  /**
355
355
  * Updates the path of the URL.
356
356
  *
357
- * @category Setters
357
+ * @category setters
358
358
  * @since 4.0.0
359
359
  */
360
360
  export const setPathname: {
361
361
  /**
362
362
  * Updates the path of the URL.
363
363
  *
364
- * @category Setters
364
+ * @category setters
365
365
  * @since 4.0.0
366
366
  */
367
367
  (pathname: string): (url: URL) => URL
368
368
  /**
369
369
  * Updates the path of the URL.
370
370
  *
371
- * @category Setters
371
+ * @category setters
372
372
  * @since 4.0.0
373
373
  */
374
374
  (url: URL, pathname: string): URL
@@ -377,21 +377,21 @@ export const setPathname: {
377
377
  /**
378
378
  * Updates the port of the URL.
379
379
  *
380
- * @category Setters
380
+ * @category setters
381
381
  * @since 4.0.0
382
382
  */
383
383
  export const setPort: {
384
384
  /**
385
385
  * Updates the port of the URL.
386
386
  *
387
- * @category Setters
387
+ * @category setters
388
388
  * @since 4.0.0
389
389
  */
390
390
  (port: string | number): (url: URL) => URL
391
391
  /**
392
392
  * Updates the port of the URL.
393
393
  *
394
- * @category Setters
394
+ * @category setters
395
395
  * @since 4.0.0
396
396
  */
397
397
  (url: URL, port: string | number): URL
@@ -400,21 +400,21 @@ export const setPort: {
400
400
  /**
401
401
  * Updates the protocol (e.g., `http`, `https`).
402
402
  *
403
- * @category Setters
403
+ * @category setters
404
404
  * @since 4.0.0
405
405
  */
406
406
  export const setProtocol: {
407
407
  /**
408
408
  * Updates the protocol (e.g., `http`, `https`).
409
409
  *
410
- * @category Setters
410
+ * @category setters
411
411
  * @since 4.0.0
412
412
  */
413
413
  (protocol: string): (url: URL) => URL
414
414
  /**
415
415
  * Updates the protocol (e.g., `http`, `https`).
416
416
  *
417
- * @category Setters
417
+ * @category setters
418
418
  * @since 4.0.0
419
419
  */
420
420
  (url: URL, protocol: string): URL
@@ -423,21 +423,21 @@ export const setProtocol: {
423
423
  /**
424
424
  * Updates the query string of the URL.
425
425
  *
426
- * @category Setters
426
+ * @category setters
427
427
  * @since 4.0.0
428
428
  */
429
429
  export const setSearch: {
430
430
  /**
431
431
  * Updates the query string of the URL.
432
432
  *
433
- * @category Setters
433
+ * @category setters
434
434
  * @since 4.0.0
435
435
  */
436
436
  (search: string): (url: URL) => URL
437
437
  /**
438
438
  * Updates the query string of the URL.
439
439
  *
440
- * @category Setters
440
+ * @category setters
441
441
  * @since 4.0.0
442
442
  */
443
443
  (url: URL, search: string): URL
@@ -446,21 +446,21 @@ export const setSearch: {
446
446
  /**
447
447
  * Updates the username used for authentication.
448
448
  *
449
- * @category Setters
449
+ * @category setters
450
450
  * @since 4.0.0
451
451
  */
452
452
  export const setUsername: {
453
453
  /**
454
454
  * Updates the username used for authentication.
455
455
  *
456
- * @category Setters
456
+ * @category setters
457
457
  * @since 4.0.0
458
458
  */
459
459
  (username: string): (url: URL) => URL
460
460
  /**
461
461
  * Updates the username used for authentication.
462
462
  *
463
- * @category Setters
463
+ * @category setters
464
464
  * @since 4.0.0
465
465
  */
466
466
  (url: URL, username: string): URL
@@ -492,7 +492,7 @@ export const setUsername: {
492
492
  * // Output: https://example.com/?key=value
493
493
  * ```
494
494
  *
495
- * @category Setters
495
+ * @category setters
496
496
  * @since 4.0.0
497
497
  */
498
498
  export const setUrlParams: {
@@ -522,7 +522,7 @@ export const setUrlParams: {
522
522
  * // Output: https://example.com/?key=value
523
523
  * ```
524
524
  *
525
- * @category Setters
525
+ * @category setters
526
526
  * @since 4.0.0
527
527
  */
528
528
  (urlParams: UrlParams.UrlParams): (url: URL) => URL
@@ -552,7 +552,7 @@ export const setUrlParams: {
552
552
  * // Output: https://example.com/?key=value
553
553
  * ```
554
554
  *
555
- * @category Setters
555
+ * @category setters
556
556
  * @since 4.0.0
557
557
  */
558
558
  (url: URL, urlParams: UrlParams.UrlParams): URL
@@ -345,7 +345,7 @@ const extractResponseContent = (
345
345
  * Adds additional schemas to components/schemas.
346
346
  * The provided schemas must have a `identifier` annotation.
347
347
  *
348
- * @category tags
348
+ * @category services
349
349
  * @since 4.0.0
350
350
  */
351
351
  export class AdditionalSchemas extends Context.Service<
@@ -443,10 +443,10 @@ export const securityDecode = <Security extends HttpApiSecurity.HttpApiSecurity>
443
443
  HttpServerRequest | Request.ParsedSearchParams
444
444
  > => {
445
445
  switch (self._tag) {
446
- case "Bearer": {
446
+ case "Http": {
447
447
  return Effect.map(
448
448
  HttpServerRequest,
449
- (request) => Redacted.make((request.headers.authorization ?? "").slice(bearerLen)) as any
449
+ (request) => Redacted.make((request.headers.authorization ?? "").slice(self.schemeLength)) as any
450
450
  )
451
451
  }
452
452
  case "ApiKey": {
@@ -521,7 +521,6 @@ export const securitySetCookie = (
521
521
  // Internal
522
522
  // -----------------------------------------------------------------------------
523
523
 
524
- const bearerLen = `Bearer `.length
525
524
  const basicLen = `Basic `.length
526
525
 
527
526
  const HandlersProto = {
@@ -66,7 +66,7 @@ const serviceUnavailableResponse = HttpServerResponse.empty({ status: 503 })
66
66
  * Built-in HTTP API error for a `400 Bad Request` response. When used directly as
67
67
  * a server response, it renders as an empty response with status 400.
68
68
  *
69
- * @category Built-in errors
69
+ * @category errors
70
70
  * @since 4.0.0
71
71
  */
72
72
  export class BadRequest extends Schema.ErrorClass<BadRequest>("effect/HttpApiError/BadRequest")({
@@ -97,7 +97,7 @@ export const BadRequestNoContent = BadRequest.pipe(HttpApiSchema.asNoContent({
97
97
  * Built-in HTTP API error for a `401 Unauthorized` response. When used directly as
98
98
  * a server response, it renders as an empty response with status 401.
99
99
  *
100
- * @category Built-in errors
100
+ * @category errors
101
101
  * @since 4.0.0
102
102
  */
103
103
  export class Unauthorized extends Schema.ErrorClass<Unauthorized>("effect/HttpApiError/Unauthorized")({
@@ -127,7 +127,7 @@ export const UnauthorizedNoContent = Unauthorized.pipe(HttpApiSchema.asNoContent
127
127
  * Built-in HTTP API error for a `403 Forbidden` response. When used directly as a
128
128
  * server response, it renders as an empty response with status 403.
129
129
  *
130
- * @category Built-in errors
130
+ * @category errors
131
131
  * @since 4.0.0
132
132
  */
133
133
  export class Forbidden extends Schema.ErrorClass<Forbidden>("effect/HttpApiError/Forbidden")({
@@ -157,7 +157,7 @@ export const ForbiddenNoContent = Forbidden.pipe(HttpApiSchema.asNoContent({
157
157
  * Built-in HTTP API error for a `404 Not Found` response. When used directly as a
158
158
  * server response, it renders as an empty response with status 404.
159
159
  *
160
- * @category Built-in errors
160
+ * @category errors
161
161
  * @since 4.0.0
162
162
  */
163
163
  export class NotFound extends Schema.ErrorClass<NotFound>("effect/HttpApiError/NotFound")({
@@ -187,7 +187,7 @@ export const NotFoundNoContent = NotFound.pipe(HttpApiSchema.asNoContent({
187
187
  * Built-in HTTP API error for a `405 Method Not Allowed` response. When used
188
188
  * directly as a server response, it renders as an empty response with status 405.
189
189
  *
190
- * @category Built-in errors
190
+ * @category errors
191
191
  * @since 4.0.0
192
192
  */
193
193
  export class MethodNotAllowed extends Schema.ErrorClass<MethodNotAllowed>("effect/HttpApiError/MethodNotAllowed")({
@@ -217,7 +217,7 @@ export const MethodNotAllowedNoContent = MethodNotAllowed.pipe(HttpApiSchema.asN
217
217
  * Built-in HTTP API error for a `406 Not Acceptable` response. When used directly
218
218
  * as a server response, it renders as an empty response with status 406.
219
219
  *
220
- * @category Built-in errors
220
+ * @category errors
221
221
  * @since 4.0.0
222
222
  */
223
223
  export class NotAcceptable extends Schema.ErrorClass<NotAcceptable>("effect/HttpApiError/NotAcceptable")({
@@ -247,7 +247,7 @@ export const NotAcceptableNoContent = NotAcceptable.pipe(HttpApiSchema.asNoConte
247
247
  * Built-in HTTP API error for a `408 Request Timeout` response. When used directly
248
248
  * as a server response, it renders as an empty response with status 408.
249
249
  *
250
- * @category Built-in errors
250
+ * @category errors
251
251
  * @since 4.0.0
252
252
  */
253
253
  export class RequestTimeout extends Schema.ErrorClass<RequestTimeout>("effect/HttpApiError/RequestTimeout")({
@@ -277,7 +277,7 @@ export const RequestTimeoutNoContent = RequestTimeout.pipe(HttpApiSchema.asNoCon
277
277
  * Built-in HTTP API error for a `409 Conflict` response. When used directly as a
278
278
  * server response, it renders as an empty response with status 409.
279
279
  *
280
- * @category Built-in errors
280
+ * @category errors
281
281
  * @since 4.0.0
282
282
  */
283
283
  export class Conflict extends Schema.ErrorClass<Conflict>("effect/HttpApiError/Conflict")({
@@ -307,7 +307,7 @@ export const ConflictNoContent = Conflict.pipe(HttpApiSchema.asNoContent({
307
307
  * Built-in HTTP API error for a `410 Gone` response. When used directly as a
308
308
  * server response, it renders as an empty response with status 410.
309
309
  *
310
- * @category Built-in errors
310
+ * @category errors
311
311
  * @since 4.0.0
312
312
  */
313
313
  export class Gone extends Schema.ErrorClass<Gone>("effect/HttpApiError/Gone")({
@@ -337,7 +337,7 @@ export const GoneNoContent = Gone.pipe(HttpApiSchema.asNoContent({
337
337
  * Built-in HTTP API error for a `500 Internal Server Error` response. When used
338
338
  * directly as a server response, it renders as an empty response with status 500.
339
339
  *
340
- * @category Built-in errors
340
+ * @category errors
341
341
  * @since 4.0.0
342
342
  */
343
343
  export class InternalServerError
@@ -368,7 +368,7 @@ export const InternalServerErrorNoContent = InternalServerError.pipe(HttpApiSche
368
368
  * Built-in HTTP API error for a `501 Not Implemented` response. When used directly
369
369
  * as a server response, it renders as an empty response with status 501.
370
370
  *
371
- * @category Built-in errors
371
+ * @category errors
372
372
  * @since 4.0.0
373
373
  */
374
374
  export class NotImplemented extends Schema.ErrorClass<NotImplemented>("effect/HttpApiError/NotImplemented")({
@@ -397,7 +397,7 @@ export const NotImplementedNoContent = NotImplemented.pipe(HttpApiSchema.asNoCon
397
397
  * Built-in HTTP API error for a `503 Service Unavailable` response. When used
398
398
  * directly as a server response, it renders as an empty response with status 503.
399
399
  *
400
- * @category Built-in errors
400
+ * @category errors
401
401
  * @since 4.0.0
402
402
  */
403
403
  export class ServiceUnavailable
@@ -445,7 +445,7 @@ export const HttpApiSchemaErrorTypeId: HttpApiSchemaErrorTypeId = "~effect/httpa
445
445
  * which component failed and responds as an empty `400 Bad Request` when rendered
446
446
  * as a server response.
447
447
  *
448
- * @category Parsing errors
448
+ * @category errors
449
449
  * @since 4.0.0
450
450
  */
451
451
  export class HttpApiSchemaError extends Data.TaggedClass("HttpApiSchemaError")<{
@@ -51,7 +51,7 @@ const TypeId = "~effect/httpapi/HttpApiSecurity"
51
51
  * @category models
52
52
  * @since 4.0.0
53
53
  */
54
- export type HttpApiSecurity = Bearer | ApiKey | Basic
54
+ export type HttpApiSecurity = Http | ApiKey | Basic
55
55
 
56
56
  /**
57
57
  * Helper types for HTTP API security schemes.
@@ -82,13 +82,16 @@ export declare namespace HttpApiSecurity {
82
82
  }
83
83
 
84
84
  /**
85
- * Bearer token security scheme whose decoded credential is a redacted token.
85
+ * Http token security scheme whose decoded credential is a redacted token.
86
86
  *
87
87
  * @category models
88
88
  * @since 4.0.0
89
89
  */
90
- export interface Bearer extends HttpApiSecurity.Proto<Redacted> {
91
- readonly _tag: "Bearer"
90
+ export interface Http extends HttpApiSecurity.Proto<Redacted> {
91
+ readonly _tag: "Http"
92
+ readonly scheme: string
93
+ /** @internal */
94
+ readonly schemeLength: number
92
95
  }
93
96
 
94
97
  /**
@@ -131,6 +134,34 @@ const Proto = {
131
134
  }
132
135
  }
133
136
 
137
+ /**
138
+ * Creates a Http token security scheme.
139
+ *
140
+ * **When to use**
141
+ *
142
+ * Use to require `Authorization: scheme ...` credentials for an HTTP API group
143
+ * or endpoint.
144
+ *
145
+ * **Details**
146
+ *
147
+ * Use `HttpApiBuilder.middlewareSecurity` to implement API middleware for this
148
+ * security scheme.
149
+ *
150
+ * @see {@link apiKey} for an API-key security scheme
151
+ * @see {@link basic} for an HTTP Basic security scheme
152
+ * @category constructors
153
+ * @since 4.0.0
154
+ */
155
+ export const http = (options: {
156
+ readonly scheme: string
157
+ }): Http =>
158
+ Object.assign(Object.create(Proto), {
159
+ _tag: "Http",
160
+ scheme: options.scheme,
161
+ schemeLength: options.scheme.length,
162
+ annotations: Context.empty()
163
+ })
164
+
134
165
  /**
135
166
  * Creates a Bearer token security scheme.
136
167
  *
@@ -149,10 +180,7 @@ const Proto = {
149
180
  * @category constructors
150
181
  * @since 4.0.0
151
182
  */
152
- export const bearer: Bearer = Object.assign(Object.create(Proto), {
153
- _tag: "Bearer",
154
- annotations: Context.empty()
155
- })
183
+ export const bearer: Http = http({ scheme: "Bearer" })
156
184
 
157
185
  /**
158
186
  * Creates an API key security scheme.
@@ -730,7 +730,7 @@ const makeSecurityScheme = (security: HttpApiSecurity): OpenAPISecurityScheme =>
730
730
  scheme: "basic"
731
731
  }
732
732
  }
733
- case "Bearer": {
733
+ case "Http": {
734
734
  const format = Context.getOption(security.annotations, Format).pipe(
735
735
  Option.map((format) => ({ bearerFormat: format })),
736
736
  Option.getOrUndefined
@@ -738,7 +738,7 @@ const makeSecurityScheme = (security: HttpApiSecurity): OpenAPISecurityScheme =>
738
738
  return {
739
739
  ...meta,
740
740
  type: "http",
741
- scheme: "bearer",
741
+ scheme: security.scheme,
742
742
  ...format
743
743
  }
744
744
  }
@@ -72,7 +72,7 @@ export type MetricNameMapper = (name: string) => string
72
72
  /**
73
73
  * Options for formatting metrics.
74
74
  *
75
- * @category models
75
+ * @category options
76
76
  * @since 4.0.0
77
77
  */
78
78
  export interface FormatOptions {
@@ -90,7 +90,7 @@ export interface FormatOptions {
90
90
  /**
91
91
  * Options for exporting Prometheus metrics over HTTP.
92
92
  *
93
- * @category models
93
+ * @category options
94
94
  * @since 4.0.0
95
95
  */
96
96
  export interface HttpOptions extends FormatOptions {
@@ -128,7 +128,7 @@ export interface HttpOptions extends FormatOptions {
128
128
  * })
129
129
  * ```
130
130
  *
131
- * @category Formatting
131
+ * @category formatting
132
132
  * @since 4.0.0
133
133
  */
134
134
  export const format: (options?: FormatOptions | undefined) => Effect.Effect<string> = Effect.fnUntraced(
@@ -146,7 +146,7 @@ export const format: (options?: FormatOptions | undefined) => Effect.Effect<stri
146
146
  * Use when you use this low-level function when you already have access to the context. Most
147
147
  * users should use `format` instead.
148
148
  *
149
- * @category Formatting
149
+ * @category formatting
150
150
  * @since 4.0.0
151
151
  */
152
152
  export const formatUnsafe = (
@@ -114,7 +114,7 @@ export interface KeyValueStore {
114
114
  * Primitive operations are required, while helpers such as `has`, `isEmpty`,
115
115
  * and `modify` can be supplied to override the defaults.
116
116
  *
117
- * @category models
117
+ * @category options
118
118
  * @since 4.0.0
119
119
  */
120
120
  export type MakeOptions = Partial<KeyValueStore> & {
@@ -153,7 +153,7 @@ export type MakeOptions = Partial<KeyValueStore> & {
153
153
  * Implementation callbacks for adapting a string-only backing store into a
154
154
  * `KeyValueStore`.
155
155
  *
156
- * @category models
156
+ * @category options
157
157
  * @since 4.0.0
158
158
  */
159
159
  export type MakeStringOptions = Partial<Omit<KeyValueStore, "set">> & {
@@ -214,7 +214,7 @@ export class KeyValueStoreError extends Data.TaggedError("KeyValueStoreError")<{
214
214
  * Use to access or provide the persistence store used for lightweight durable
215
215
  * state.
216
216
  *
217
- * @category tags
217
+ * @category services
218
218
  * @since 4.0.0
219
219
  */
220
220
  export const KeyValueStore: Context.Service<
@@ -235,7 +235,7 @@ const exitSchemaCache = new WeakMap<Persistable<any, any>, Schema.Exit<any, any,
235
235
  * Encodes an `Exit` for a persistable request using its success and error
236
236
  * schemas.
237
237
  *
238
- * @category Serialization
238
+ * @category serialization
239
239
  * @since 4.0.0
240
240
  */
241
241
  export const serializeExit = <A extends Schema.Top, E extends Schema.Top>(
@@ -250,7 +250,7 @@ export const serializeExit = <A extends Schema.Top, E extends Schema.Top>(
250
250
  * Decodes a persisted value into an `Exit` for a persistable request using its
251
251
  * success and error schemas.
252
252
  *
253
- * @category Serialization
253
+ * @category serialization
254
254
  * @since 4.0.0
255
255
  */
256
256
  export const deserializeExit = <A extends Schema.Top, E extends Schema.Top>(