Skip to content

Releases: freshOS/Networking

Adds PrivacyInfo.xcprivacy

06 Mar 07:33
Compare
Choose a tag to compare
2.0.3

Copy PrivacyInfo.xcprivacy resource on target build

2.0.2-beta

15 Nov 01:10
Compare
Choose a tag to compare
2.0.2-beta Pre-release
Pre-release

Replaces POST PUT PATCH params by body parameter with an enum (.urlEncode | .json | .multipart)

1.2.4

14 Nov 00:40
Compare
Choose a tag to compare

Adds POST, PUT, PATCH Encodable body.

Example:

let data: Data = try await network.post("/users", body: Credentials(username: "john", password: "doe"))

where Credentials conforms to the Encodable protocol.

1.2.1

29 Apr 10:28
Compare
Choose a tag to compare
  • Fixes async await continuation error.

1.2.0

28 Apr 09:29
82f49fa
Compare
Choose a tag to compare

Adds jsonDecoderFactory to provide your own JSONDecoder.

network.jsonDecoderFactory = {
    let decoder = JSONDecoder()
    let df = DateFormatter()
    df.locale = Locale(identifier: "en_US_POSIX")
    df.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
    decoder.dateDecodingStrategy = .formatted(df)
    return decoder
}

1.1.1

13 Apr 13:16
Compare
Choose a tag to compare
  • Async-Await api is here 🎉

1.1.0

12 Apr 15:38
949a1af
Compare
Choose a tag to compare
1.1.0 Pre-release
Pre-release
  • async-await api is here !

1.0.0

07 Apr 09:14
3323942
Compare
Choose a tag to compare
  • Fixes naming issues detailed here #42
  • Includes #43 Thanks @elijah-rappaport
  • Bumps to 1.0.0, this has now been used in many production apps long enough 🚀

0.3.5

28 Nov 18:48
Compare
Choose a tag to compare
  • Fixes "?" added at the end of GET requests without any params. Found by @adomingd and fixed by @workingDog

0.3.4

28 Oct 14:06
8792ccd
Compare
Choose a tag to compare
  • Solves #26
  • Add the ability to retry a request with a middleWare via requestRetrier

The typical example use case is reauthenticating before retrying a request:

private var isRetrying = CurrentValueSubject<Bool, Error>(false)

init() {
    restAPI.network.requestRetrier = { [unowned self] _, error in
        if self.isRetrying.value == true {
            return self.isRetrying.filter({ !$0 }).asVoid().eraseToAnyPublisher()
        }
        guard let error = error as? NetworkingError, error.status == .unauthorized else {
            return nil
        }
        return restAPI.authenticate().eraseToAnyPublisher()
    }
}

Thanks @denis-obukhov for this improvement !