- 4283373: Fix @effect/platform peer dependency version.
- 275073e: Effect minor update.
- ff3f49d: Remove
Types.Simplify
on client response type. - 5d7c516: Improve swagger UI serving. It can be accessed from
/docs
,/docs/
and/docs/index.html
. If used separately, it takes into account a route prefix.
- 03a9d8c: Disable keep-alive for the testing client.
- 03a9d8c: Update swagger-ui-dist and schema-openapi.
- 65e09c5: Update schema-openapi.
- 5b25320: Disable keep-alive for the testing client.
- fd33667: Update @effect/schema peer dependency.
- 8cf21d6: Update @effect/platform.
- 48b6938: Update @effect/schema.
- 0fe0008: Add
server
OpenAPI option.
- cf7b958: Fix OpenAPI parameters generations.
- b8a357e: Support
Schema.union
for OpenAPI parameters.
- a414555: Update effect.
- 4f5a138: Update effect.
- 07bd2ac: Update dependencies.
- 7b1e612: add real groups for storing options used in openapi generation
- 2730164: Update dependencies.
- f96ed25: Update @effect/schema.
- 7537645: Add deprecated option to endpoint
- 4c57801: Add
summary
OpenApi option for `Api. @KhraksMamtsov
- 97e1307: Use raw strings instead of URL. Use @effect/platform query and path parameters.
- 97e1307: Add
enableDocs
RouterBuiler option.
- fa10e8a: Update effect.
- 3b4a08c: Update effect + @effect/schema.
- 2554a22: Updated build setup
- 3457ae1: Update effect.
- 27af725: Fix: use
ClientRequestEncoder
forMockClient
. - 27af725: Update @effect/platform.
- cc2dd9b: Add new
ExampleServer.handle
andExampleServer.handleRemaining
utils.
- 47c1fe7: Update @effect/platform.
- 9e678bd: Update effect.
- 940165a: Update effect.
- d47cde5: Fix internal modules imports.
- 139e562: Update dependencies.
- 3464ad2: Update dependencies.
- 32147bc: Update effect.
-
24bce47: User-land content type handling.
- Add
Representation
module. - Update response parsing and encoding so that it uses the
Representation
object to decide on the serialization and deserialization of HTTP content. ServerError
module exposes interface instead of class for the error model.
- Add
-
80100bd: Update effect.
- 57a9122: Update dependencies.
- cb7f4df: Update swagger-ui-dist.
- ea57f51: Make
@effect/platform
a peer dependency.
- 34a3b5b: Remove
trace
method. - 34a3b5b: Finish CORS middleware.
- 49a2efe: Fix CORS middleware.
- d98d8bc: Refactor
ClientError
module. - d98d8bc: Add
Testing.makeRaw
.
- 15974df: Add @effect/platform-node as an optional dependency.
- d98d8bc: Update dependencies.
- d98d8bc: CORS middleware.
- a054d92: Make
SwaggerRouter
platform agnostic.
- 6cb924d: Load platform-node lazily.
- 5b2b478: Update schema-openapi.
- a74988e: Update @effect/platform.
- d5af5ff: Allow specifying
ParseOptions
for aRouterBuilder
request validation.
- 139bf95: Update @effect/schema.
- cf4a7f7: Full OpenApi info can be set when calling the
Api.api
.
- 1fd4303: Update @effect/platform.
-
8536f36: WARNING: LOT OF BREAKING CHANGES AHEAD
Boht the public API of the package and internals were rewritten.
The
express
dependency was completely discarded. Thus there is no longer support nor a recommended way to interop with non-effect libraries. Instead, theeffect-http
is rather meant to be a declarative wrapper and utility library for@effect/platform/Http
.The library now exposes a set of modules instead of big
Http
reexport of all public symbols.- Api is the main API for describing HTTP interfaces. From the usage perspective, nothing really changed there.
- RouterBuilder exposes the
handle
function and it internally builds a@effect/platform/Http/Router
structure. It's created fromApi.Api
and the type machinery enforces compatibilty of the server implementation with theApi.Api
declaration. TheRouterBuilder.build
builds a@effect/platform/Http/App
instance with OpenAPI and implemented handlers. - Route exposes combinators internally used by
RouterBuilder
but can be used in the user-space as well. - ClientError exposes data structures for client-side errors.
- ServerError exposes data structures for server-side errors.
- SwaggerRouter provides a
@effect/platform
native implementation of a router handling Swagger UI. - NodeServer is a simple utility for running the generated
App
. - ExampleServer generates
RouterBuilder
insteace with dummy responses. - OpenApi gives us the ability to convert
Api.Api
onto an OpenAPI specification. It is internally used byRouterBuilder.build
. - Client generates a client interface for the
Api.Api
. - MockClient also generates a client interface for the
Api.Api
but it return dummy responses. - Testing can be used for testing HTTP API implementations. It is also used internally for
effect-http
testing. Now, it actually spaws the real server on a random port and triggers the endpoints throughout the network. - Middlewares replaces the old
Extension
module. It doesn't expose its own interface and instead it only exposes some handy middlewares built directly for@effect/platform/Http/Middleware
.
OpenAPI spec now enables components using a
Schema.identifier
- by @arnonym.ResponseUtil
utilityHttp.Input
type utility
Please refer to the README and examples.
-
30d07ce: Update dependencies.
- 8d4255b: Update effect.
- d0a5e94: Fix: testing client works with form data.
- fdb438c: Update effect.
- 3da55b7: Update effect.
- 12bfe12: Update effect.
- e545f0c: Fix import.
- 325f0a4: Update effect.
- a65a9b2: Refactor client errors.
- 7e4546b: Update @effect/platform.
- 757bd90: Update dependencies.
- bce4f7e: Refactor: rewrite client using @effect/platform.
- 3211930: Update effect.
- 5b6d151: Update effect.
- 42731e2: Update effect.
- 28ed55b: Update effect dependencies.
- ecca038: Update @effect/schema.
- 7f57b7d: Update @effect/platform-node.
- 9a4387d: Update effect.
- 9a4387d: Introduce
@effect/platform
Router derivation.
- 13a9a09: Update dependencies.
- 59d75db: Update /data and /io.
- a37157e: Fix @effect/io peer dependency version.
- fd69e9c: Update effect dependencies.
- 9dd1613: Update effect dependencies.
- f56d5a9: Expose
/openapi.json
.
- 43bab8a: Fix testing client - set content-* headers if body is provided.
- ab622b0: Update schema-openapi - fixes example server with constrained numbers in schemas.
- 295d6d6: Update schema-openapi.
- edb5531: Update dependencies.
- 4adc5f9: Update schema-openapi.
- 09af1a2: Make
mockClient
data-first.
- 5528872: Handle
FormData
on the server. - 9e9a9b3: Implement
Pipeable
forApi
andServerBuilder
. - d964b02: Move
FormData
schema toApi
module.
- df37219: Update schema-openapi.
- db02159: Change /io, /data and /schema to peer dependencies.
- 2d710d7: Support
FormData
on the client side.
- 05185c2: Fix exports.
- 122d536: Add readme to dist.
- 1a86946: Fix build.
- 95c82c9: Update /io and /schema.
- 95c82c9: ESM fix by @vecerek
- 5e4f71c: Fix client usage in browser. Express related libraries will load lazily. This is rather a quick fix preceding a proper solution.
- 68749c9: Testing client returns type-safe response object.
- e21ef69: Update /io and /schema.
- 9e5bc29: Update /data, /io and /schema.
- 5bcd82c: Update dependencies.
- d84944e: Update /schema dependencies.
- d301880: Update /data.
-
71d9a3d: Make
Http.client
data-first.Instead of
const client = pipe(api, Http.client(url, options));
use
const client = Http.client(api, url, options);
-
e0fa6e6: Remove
effect-log
and logging functionality. -
7ee7ec3: Custom response. Remove possibility to return
Response
.
- db40417: Fix OpenApi path string format.
- 368ae52: Make sure path string matches the param schema.
- 310cb15: Fix optional path parameters.
- 7ce5cec: Fix OpenApi parameter types.
- 21a3cff: Fix OpenApi required flag.
- c24e990: Split server building into two parts.
- b9b8b2b: Change api schemas struture. All request locations are specified using Schema instead of record of Schemas.
-
ff37dfc: Multiple responses, response headers, client input type fixes.
This release allows to specify different status codes to return different responses and headers.
const api = pipe( Http.api(), Http.post("hello", "/hello", { response: [ { status: 201, content: Schema.number, }, { status: 200, content: Schema.number, headers: { "X-Another-200": Schema.NumberFromString, }, }, { status: 204, headers: { "X-Another": Schema.string }, }, ], }), );
Specified response combinations are propagated to the OpenApi.
The generated client in case of multiple responses returns an object
{ status, content, headers }
, the proper union type is generated in that case. -
dbe343f: Derivation of
ResponseUtil
object.
- 1dcd434: Update schema-openapi.
- 693d85e: Example server has precise
Api
type.
- 97c23b8: Update /data and /io.
- 28327db: Update schema-openapi and /schema.
- dc8d503: Update dependencies.
- 19a26ab: Update /data and /io.
- c245afd: Update dependencies.
- d380340: Update dependencies.
- 49828cf: Update dependencies.
- 1431d2e: Update dependencies.
- 111d2ed: Fix commonjs.
- 392d0cf: Update dependencies.
- 8237fff: Fix build.
-
ccd9911: Extensions.
- added basic auth built-in extension
- added
OnErrorExtension
extension type - added
ServerExtensionOptions
which allow white-/black-listing operations for extensions
- cb022a4: Update dependencies.
- e281dd5: Remove unnecessary files from the build.
- 5e5ef61: Introduce extensions.
- d704fe0: Testing module.
- 223e8ea: Update dependencies.
- 0a66561: Remove
Any*
type variants.
- 4ba83cf: Update dependencies.
-
2e0c01f: Add support for descriptions.
- Descriptions are generated for schemas with
DescriptionAnnotation
. - Endpoint methods (
Http.get
,Http.post
, etc) accept an optional 4th argument with description of the operation.
- Descriptions are generated for schemas with
- d679e96: Update dependencies.
- 8d8010f: Fix common js imports.
- a11af53: Remove docs from the package.
- bf5b0bb: Update dependencies.
- fdde411: Flatten package file structure.
- 1627a6a: Generate API documentation.
- d7133fb: Update package.json homepage.
- 03df92d: Fix imports.
- e731be3: Update dependencies (effect-log and schema-openapi support esm).
- 0fc27ef: Update dependencies.
- 4a60b11: Add esm support.
- 7812314: Allow client http calls to be interrupted.
- 3604908: Update dependencies.
- cd5baf2: Update dependencies.
- 114a41f: Update dependencies.
- fb2ce23: Fix build.
- 77ee530: Client common headers. Inputs of client operation functions can be ommited if there are no required inputs for the request.
- 69fb81f: Update dependencies. Schema.optionFromNullable doesn't include
undefined
.
- 04d23cd: Update dependencies
- 4fa28e3: Update dependencies.
schema-openapi
fixes usage ofSchema.optionFromNullable
. - cb52845: Throw an error when GET endpoint specifies body
- 81412cc: Use encode for response serialization.
- 130fdd8: Update dependencies
- b222abb: Introduce mock client derivation.
- aeacd10: Update dependencies
- 336001c: Fix
/docs
endpoint
- 325ef5a: Update schema-openapi
- aaf554e: Remove test related files from build
- 6f7060e: Update dependencies
- c3846a1: Use Fetch API
Request
/Response
internally.
- 06e68e4: Replace undici by Fetch API
- 3ee7377: Add default express handler with 404 response
- 922437a: Provide
ValidationErrorFormatter
through the context with default
- 4521c2f: Propagate Server dependency
R
type to handler.
- c669452: Response object to enable custom status code and response headers.
- 42aa9c6: prevent accidental introduction of duplicate operation ids
- 340e70a: Move general endpoint handling logic to server.
- 08af565: add effect-log dependency
- 22552ea: Improve server stopping log message
-
2eb96bb: Rewrite endpoint handling using
Runtime
.Http.express
,Http.listen
and newHttp.listenExpress
functions now returnEffect
instead of promise.- Options object of
Http.express
was extended byvalidationErrorFormatter
field that configures how are HTTP validation errors formatted. Http.listen
andHttp.listenExpress
options object was extended byport
andlogger
fields.Http.setLogger
was removed in favor of the configuration above.Http.provideService
andHttp.provideLayer
were removed because the context is now propagated from the top-level effect. Simply provide the context for the app effect instead. Also, scoped services are now guaranteed to be safely released when the whole app closes - currently, on SIGTERM and SIGINT signals.
pipe( server, Http.listen({ port: 3000 }), Effect.provideLayer(layer), Effect.runPromise, );
- 12b70ae: ExampleServer internal and public modules
- 624aa2b: Update effect-log and remove "module" field from package.json
- 6de1bf7: split internal and public modules
- fbb4b9a: OpenAPI configuration options for
Http.express
- bb16a9a: extend errors
- e6ff1c5: update dependencies
- 11e3874: add support for request headers
- 0c3232f: update dependencies
- ecceadb: improve error response and logging
- 21b0484: update @effect/schema
- 768a058: pattern error reporting
- aca1545: fix query and path parameters to enable correct OpenAPI derivation
- f89fa9a: update dependencies
- 0c8dee2: update deps
- 80cb3e8: fix client params
- 5337609: improve logger settings
- af57359: error handling, human-readable error details
- 9107ac0: fix build
- 06056f1: listening log on startup
- 76c5300: improve grouping api
- 0f58e68: Input type helper
- 5b682f5: add
Http.setLogger
- 39b1c3e: Introduce
exampleServer
, move title and version toApi
- 4b7c67a: Fix handling of JSON responses
- de54069: Fix: provideLayer and provideService
- bfb9c21: remove log annotations
- 5366eb0: lazy layers
- 12a731b: api and server
- client
- Initial release