Skip to content

Commit

Permalink
fix corrupt CI workflow file (#53)
Browse files Browse the repository at this point in the history
* feat: add decoding capability in case of failure caused due to HTTP status code

Resolves: none.

* feat: override User-Agent HTTP header in session configuration (#26)

Resolves: none.

* Add macOS example (#27)

* feat: move iOS example project into new sub folder

Resolves: none.

* fix: update framework search paths

Resolves: none.

* feat: add empt macOS example project to workspace

Resolves: none.

* fix: update framework scheme name

Resolves: none.

* feat: add files to macOS example directory

Resolves: none.

* fix: apply public access modifier to DefaultHTTPErrorBody and DefaultNetworkAPIError

Resolves: none.

* refactor: add description comment for ProcessInfo extension

Resolves: none.

* fix: add RxNetworkKit bridging header reference

Resolves: none.

* refactor: apply project recommended settings

Resolves: none.

* feat: connect viewModel to tableview UI

Resolves: none.

* feat: complete ViewController class in macOS Example

Resolves: none.

* refactor: remove old un-needed file

Resolves: none.

* fix: apply correct image scale for error view

Resolves: none.

* Apply new version (0.0.2) (#28)

* fix: remove tinted button warning

Resolves: none.

* version: 0.0.2

Resolves: none.

* fix: update version for podSpec file

Resolves: none.

* fix: remove RxDataSources import statement (#31)

Resolves: none.

* Add CI Workflows For Repository (#33)

* feat: add iOS workflow

Resolves: none.

* fix: update build-ios.yml

Resolves: none.

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Create build-macos.yml

* Update build-ios.yml + build-macos.yml

* fix error 65

* Update build-ios.yml

* update build-ios.yml + build-macos.yml

* Update build-macos.yml

* Update project.pbxproj

* add publish-podspec.yml

* add workflow files outside of folders

* Update publish-podspec.yml

* Update publish-podspec.yml

* Update publish-podspec.yml

* Create pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* test container workflow

* Update build.yml

* Update build.yml

* add some changes

* Update build.yml

* add some changes

* Update build.yml

* refactor: update names + remove comments

Resolves: none.

* add trigger for trunk push workflow

* add dummy project to test SPM integration

* add spm-lint.yml

* Update spm-lint.yml

* Update spm-lint.yml

* Update spm-lint.yml

* Update spm-lint.yml

* update dummy project

* update workspace dependencies versions

* Update CI Workflows

* update CI workflows

* Update CI Workflow

* Update Dependency Version Rules (#45)

* fix: update version rules for SPM to upToNextMajor

Resolves: none.

* fix: update version rule for SPM in iOS Example project

Resolves: none.

* fix: update version rules for cocoapods in podspec file

Resolves: none.

* feat: add WebSocket capability to NetworkManager (#46)

Resolves: none.

* fix a typo

* update dependencies versions

Resolves: none.

* update Package.swift + podspec file

* change xcode version used in CI/CD to 14.3.1

Resolves: none.

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update build.yml

* Update build.yml

* update workflow files

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update pod-trunk-push.yml

* Update spm-lint.yml

* Update build-macos.yml

* update Xcode version to 15.0.0 for CI workflows

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* Update pod-lib-lint.yml

* break: drop support for Cocoapods (cannot work with Xcode 15)

Resolves: none.

* [49][DocC][Update Documentation] (#50)

* feat: update overview for classes, structs, enums, typaliases and protocols

Resolves: none.

* feat: add docs catalog

Resolves: none.

* update CI workflows to build docs

Resolves: none.

* update CI workflows

Resolves: none.

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* Update build-ios.yml

* fix: update corrupt ci workflow file

Resolves: none.
  • Loading branch information
loay-ashraf committed Oct 5, 2023
1 parent 19eaaad commit bfdb319
Show file tree
Hide file tree
Showing 38 changed files with 268 additions and 108 deletions.
File renamed without changes.
26 changes: 26 additions & 0 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@ on:
workflow_call:

jobs:
framework-docs:
name: Build Framework Docs
runs-on: macos-13

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0.0'
- name: Build Docs
env:
workspace: RxNetworkKit.xcworkspace
scheme: RxNetworkKit
destination: generic/platform=iOS Simulator
run: |
xcodebuild docbuild -workspace "${workspace}" -scheme "${scheme}" -destination "${destination}" -derivedDataPath derivedData | xcpretty && exit ${PIPESTATUS[0]}
mkdir docArchives
cp -R `find derivedData -type d -name "*.doccarchive"` docArchives
- name: Deploy Docs
run: |
cd docArchives
ls
$(xcrun --find docc) process-archive transform-for-static-hosting docArchives/RxNetworkKit.doccarchive --hosting-base-path RxNetworkKit --output-path docs
framework-ios-simulator:
name: Build Framework For iOS Simulator
runs-on: macos-13
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
scheme: RxNetworkKit
destination: generic/platform=macOS
run: |
xcodebuild clean build -workspace "${workspace}" -scheme "${scheme}" -destination "${destination}" | xcpretty && exit ${PIPESTATUS[0]}
xcodebuild clean build -workspace "${workspace}" -scheme "${scheme}" -destination "${destination}" docbuild | xcpretty && exit ${PIPESTATUS[0]}
example-macos:
name: Build Example For macOS
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/pod-lib-lint.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/pod-trunk-push.yml

This file was deleted.

37 changes: 37 additions & 0 deletions Docs.docc/Pages/NetworkManager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ``NetworkManager``

## Topics

### Creating a Network Manager

- ``NetworkManager/init(configuration:requestInterceptor:eventMonitor:)``

### Making a Request

- ``NetworkRouter``
- ``NetworkManager/request(_:_:_:)-2m73c``
- ``NetworkManager/request(_:_:_:)-2icwe``

### Downloading a File

- ``NetworkDownloadRouter``
- ``DownloadEvent``
- ``NetworkManager/download(_:_:_:)``
- ``NetworkManager/download(_:_:_:_:)``

### Uploading a File

- ``NetworkUploadRouter``
- ``UploadEvent``
- ``UploadFile``
- ``UploadFormData``
- ``NetworkManager/upload(_:_:_:_:)-5aqfe``
- ``NetworkManager/upload(_:_:_:_:)-4xcrt``

### Connecting to a WebSocket

- ``WebSocket``
- ``WebSocketMessage``
- ``WebSocketCloseCode``
- ``WebSocketCloseHandler``
- ``NetworkManager/webSocket(_:_:_:)``
54 changes: 54 additions & 0 deletions Docs.docc/Pages/RxNetworkKit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# ``RxNetworkKit``

a lightweight networking framework based on URLSession and RxSwift.

## Overview

RxNetworkKit fits nicely in your project if you use RxSwift and RxCocoa mainly in your project.

It makes use of RxSwift's traits at request level to acheive a high level of specialization for observed request sequence and expected output from it.

### Full of Goodies:
- includes download and upload capabillity with progress tracking all within the same observable sequence.
- includes websocket capabillity for observing remote data updates.
- includes a request interceptor protocol that can be implemented for request adaptation and retry on failure.
- comes with a reachability class that you can observe from anywhere for reachability status.

## Topics

### Foundation

- ``NetworkManager``

### HTTP

- ``HTTPScheme``
- ``HTTPMethod``
- ``HTTPStatusCode``
- ``HTTPErrorBody``
- ``DefaultHTTPErrorBody``

### Error

- ``NetworkError``
- ``NetworkAPIError``
- ``DefaultNetworkAPIError``
- ``NetworkClientError``
- ``NetworkServerError``

### Request Interceptor

- ``NetworkRequestInterceptor``
- ``NetworkRequestAdapter``
- ``NetworkRequestRetrier``
- ``NetworkRequestRetryPolicy``

### Event Monitor

- ``NetworkEventMonitor``

### Network Reachability

- ``NetworkReachability``
- ``NetworkReachabilityStatus``
- ``NetworkInterfaceType``
4 changes: 4 additions & 0 deletions RxNetworkKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
0B77E0BD29D968DE0077FBC0 /* RxSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 0B77E0BC29D968DE0077FBC0 /* RxSwift */; };
0B77E0C029D969370077FBC0 /* RxSwiftExt in Frameworks */ = {isa = PBXBuildFile; productRef = 0B77E0BF29D969370077FBC0 /* RxSwiftExt */; };
C6049B162A95307800E5727E /* RxNetworkKit.h in Headers */ = {isa = PBXBuildFile; fileRef = C6049B152A95307800E5727E /* RxNetworkKit.h */; };
C69A78562ACF001400ECF092 /* Docs.docc in Sources */ = {isa = PBXBuildFile; fileRef = C69A78552ACEFF3200ECF092 /* Docs.docc */; };
C6A9BEF62A93E2AE00459E32 /* DefaultHTTPErrorBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6A9BEF52A93E2AE00459E32 /* DefaultHTTPErrorBody.swift */; };
C6A9BEF82A93E2D600459E32 /* HTTPErrorBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6A9BEF72A93E2D600459E32 /* HTTPErrorBody.swift */; };
C6A9BEFA2A93F16200459E32 /* URLSessionConfiguration+setAdditionalHTTPHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6A9BEF92A93F16200459E32 /* URLSessionConfiguration+setAdditionalHTTPHeader.swift */; };
Expand Down Expand Up @@ -120,6 +121,7 @@
0B77E08729D965D30077FBC0 /* NetworkRouter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkRouter.swift; sourceTree = "<group>"; };
0B77E08829D965D30077FBC0 /* NetworkUploadRouter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkUploadRouter.swift; sourceTree = "<group>"; };
C6049B152A95307800E5727E /* RxNetworkKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RxNetworkKit.h; sourceTree = "<group>"; };
C69A78552ACEFF3200ECF092 /* Docs.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = Docs.docc; sourceTree = "<group>"; };
C6A9BEF52A93E2AE00459E32 /* DefaultHTTPErrorBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultHTTPErrorBody.swift; sourceTree = "<group>"; };
C6A9BEF72A93E2D600459E32 /* HTTPErrorBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPErrorBody.swift; sourceTree = "<group>"; };
C6A9BEF92A93F16200459E32 /* URLSessionConfiguration+setAdditionalHTTPHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URLSessionConfiguration+setAdditionalHTTPHeader.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -152,6 +154,7 @@
0B77DFCC29D964D40077FBC0 = {
isa = PBXGroup;
children = (
C69A78552ACEFF3200ECF092 /* Docs.docc */,
0B6BD87329DC0A9400502F47 /* Package.swift */,
0B77E04A29D965D30077FBC0 /* Source */,
0B77DFD729D964D40077FBC0 /* Products */,
Expand Down Expand Up @@ -485,6 +488,7 @@
0B77E09E29D965D30077FBC0 /* HTTPStatusCode.swift in Sources */,
0B77E08D29D965D30077FBC0 /* UploadFormData.swift in Sources */,
0B77E0AF29D965D30077FBC0 /* Single+Decodable.swift in Sources */,
C69A78562ACF001400ECF092 /* Docs.docc in Sources */,
0B77E0A129D965D30077FBC0 /* NWInterfaceType+RawRepresentable.swift in Sources */,
0B77E0A529D965D30077FBC0 /* NetworkEventMonitor.swift in Sources */,
0B77E0B129D965D30077FBC0 /* Observable+Decodable.swift in Sources */,
Expand Down
20 changes: 0 additions & 20 deletions RxNetworkKitX.podspec

This file was deleted.

1 change: 1 addition & 0 deletions Source/Custom Requests/Download/DownloadEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Foundation

/// An enumeration of the types of events received during a download operation.
public enum DownloadEvent {
case completed
case completedWithData(data: Data?)
Expand Down
1 change: 1 addition & 0 deletions Source/Custom Requests/Upload/UploadEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Foundation

/// An enumeration of the types of events received during an upload operation.
public enum UploadEvent<T: Decodable> {
case completed(model: T)
case progress(progress: Progress)
Expand Down
10 changes: 10 additions & 0 deletions Source/Custom Requests/Upload/UploadFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@

import Foundation

/// Holds file details for multipart form upload,
public struct UploadFile {

/// key used for file record.
let key: String
/// name of file in the file record.
let name: String
/// local url of the file.
let url: URL?
/// data of the file.
let data: Data?
/// MIME type of the file.
let mimeType: HTTPMIMEType

/// Creates `File` instance, use this initializer for relativley small files.
///
/// - Parameters:
Expand All @@ -27,6 +35,7 @@ public struct UploadFile {
guard let mime = HTTPMIMEType(fileName: name) else { return nil }
self.mimeType = mime
}

/// Creates `File` instance, use this initializer for relativley large files.
///
/// - Parameters:
Expand All @@ -41,4 +50,5 @@ public struct UploadFile {
guard let mime = HTTPMIMEType(fileName: name) else { return nil }
self.mimeType = mime
}

}
3 changes: 3 additions & 0 deletions Source/Custom Requests/Upload/UploadFormData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@

import Foundation

/// Holds details for a mulipart form upload.
public struct UploadFormData {

/// parameters (text data fields) to be included in the form HTTP body.
let parameters: [String: String]
/// files to be included in the form HTTP body.
let files: [UploadFile]

}
4 changes: 4 additions & 0 deletions Source/Error/DefaultNetworkAPIError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
// Created by Loay Ashraf on 19/02/2023.
//

/// Default type used for decoding internal api error bodies.
public struct DefaultNetworkAPIError: NetworkAPIError {

/// error message.
let message: String

}
2 changes: 1 addition & 1 deletion Source/Error/NetworkAPIError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
// Created by Loay Ashraf on 20/03/2023.
//

/// API-side internal error
/// Internal api error body type.
public protocol NetworkAPIError: Error, Decodable { }
2 changes: 1 addition & 1 deletion Source/Error/NetworkClientError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Loay Ashraf on 19/02/2023.
//

/// Client-side (transport) error
/// Client-side (transport) network error.
public enum NetworkClientError: Error {
case http(HTTPStatusCode, HTTPErrorBody?)
case serialization(Error)
Expand Down
3 changes: 3 additions & 0 deletions Source/Error/NetworkError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

import Foundation

/// Generic network error (client, server or api).
public enum NetworkError: Error {
case client(NetworkClientError)
case server(NetworkServerError)
case api(NetworkAPIError)

/// Creates `NetworkError` instance.
///
/// - Parameter response: `HTTPURLResponse` used to get response status code.
Expand All @@ -35,4 +37,5 @@ public enum NetworkError: Error {
return nil
}
}

}
2 changes: 1 addition & 1 deletion Source/Error/NetworkServerError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Loay Ashraf on 19/02/2023.
//

/// Server-side error
/// Server-side network error.
public enum NetworkServerError: Error {
case http(HTTPStatusCode, HTTPErrorBody?)
case generic(Error)
Expand Down
5 changes: 3 additions & 2 deletions Source/Event Monitor/NetworkEventMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Foundation

/// To monitor network events in a given session, all you have to do
/// is implement its delegate methods, easy and simple isn't it? 🤔.
// To monitor network events in a given session, all you have to do
// is implement its delegate methods, easy and simple isn't it? 🤔.
/// Session and Tasks delegate.
public typealias NetworkEventMonitor = URLSessionDelegate & URLSessionTaskDelegate & URLSessionDataDelegate & URLSessionStreamDelegate & URLSessionDownloadDelegate & URLSessionWebSocketDelegate
Loading

0 comments on commit bfdb319

Please sign in to comment.