This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Releases: FlineDev/Microya
Releases · FlineDev/Microya
0.7.0
0.6.1
0.6.0
0.5.0
Added
- New
mockingBehaviorparameter onApiProviderfor testing purposes. Specify one withdelayandscheduler, e.g..seconds(0.5)andDispatchQueue.main.eraseToAnyScheduler(). Providesnilby default to make actual requests. - New optional
mockedResponsecomputed property onEndpointprotocol expecting an output of typeMockedResponse. Use this to provide mocked responses when using amockingBehaviorin tests. See the PostmanEchoEndpoint in the tests for a usage example via themockconvenience method.
Changed
- Moved
baseUrlfromEndpointtoApiProvider. This allows for specifying differentbaseUrleven whenEndpointis implemented in a library by passing it in the app. - Renamed
HttpBasicAuthPlugintoHttpAuthPluginwith a newschemeparameter that accepts one of.basicor.bearerto support multiple authentication methods.
0.4.0
Added
- Microya now supports Combine publishers, just call
publisher(on:decodeBodyTo:)orpublisher(on:)instead ofperformRequest(on:decodeBodyTo:)orperformRequest(on:)and you'll get anAnyPublisherrequest stream to subscribe to. In success cases you will receive the decoded typed object, in error cases anApiErrorobject exactly like within theperformRequestcompletion closure. But instead of aResulttype you can usesinkorcatchfrom the Combine framework.
Changed
- The
queryParametersis no longer of type[String: String], but[String: QueryParameterValue]now. Existing code like["search": searchTerm]will need to be updated to["search": .string(searchTerm)]. Apart from.stringthis now also allows specifying an array of strings like so:["tags": .array(userSelectedTags)]. String & array literals are supported directly, e.g.["sort": "createdAt"]or["sort": ["createdAt", "id"]].
0.3.0
Added
- New
ApiProvidertype encapsulating different request methods with support for plugins. - New asynchronous
performRequestmethods with completion callbacks. (#2) - New
Pluginclass to subclass for integrating into the networking logic via callbacks. - New pre-implemented plugins:
HttpBasicAuth,ProgressIndicator,RequestLogger,ResponseLogger. - New
EmptyResponseBodytype to use whenever the body is expected to be empty or should be ignored.
Changed
- Renamed
JsonApiprotocol toEndpoint. - Renamed
MethodtoHttpMethodand addedbody: Datato the casespostandpatch. - Moved the
requestmethod fromJsonApito the newApiProvider& renamed toperformRequestAndWait. - Generally improved the cases in
JsonApiError& renamed the type toApiError. - Moved CI from Bitrise to GitHub Actions.