Skip to content

Commit

Permalink
0.11.0 (#112)
Browse files Browse the repository at this point in the history
* wip

* refactoring

* wip

* wip

* wip

* wip

* wip

* version

* wip

* wip

* wip

* wip

* wip

* refactoring

* Update test.yml

* tests updated

* tests updated

* tests updated

* Carthage build fixed

* documentation updated

* demo app updated with new lib methods

* Readme updated

* cleanup

* update files list on main thread in demo app

* allow setting signature from external source

* lib version bump

* Update README.md

* Update Upload API.md

* formatting

* Update Upload API.md

* custom uploadSignature can be provided for methods:
- Upload file from url
- Multipart file uploading
-  Create files group from a set of files
- Create files group from a set of files UUIDs.
- Files group info

* custom uploadSignature can be provided for main uploadFile method that decides which upload method to use internally

* custom uploadSignature can be provided for upload method of UploadedFile object

* increase timeout for video conversion integration test

* documentation updated

* Update Sources/Uploadcare/Uploadcare.swift

Co-authored-by: Roman Sedykh <rsedykh@gmail.com>

* Update README.md

Co-authored-by: Roman Sedykh <rsedykh@gmail.com>

* Update Documentation/Upload API.md

Co-authored-by: Roman Sedykh <rsedykh@gmail.com>

* Update README.md

* Update README.md

* Update README.md

* Update Upload API.md

* Update README.md

* Update README.md

* Update Upload API.md

* Update REST API.md

* Update Documentation/REST API.md

Co-authored-by: Roman Sedykh <rsedykh@gmail.com>

* Update Documentation/REST API.md

Co-authored-by: Roman Sedykh <rsedykh@gmail.com>

* Update Documentation/Upload API.md

Co-authored-by: Roman Sedykh <rsedykh@gmail.com>

* Update Documentation/Upload API.md

Co-authored-by: Roman Sedykh <rsedykh@gmail.com>

* Update README.md

Co-authored-by: Roman Sedykh <rsedykh@gmail.com>

* Update README.md

Co-authored-by: Roman Sedykh <rsedykh@gmail.com>

* fixed when storing behavour param was missing for direct upload request

* version bump

* removed deprecated files for tests

* Swift version 5.1 -> 5.6

* removed unused allTests property in tests

* refactoring

* refactoring

* refactoring

* bumped api version to 0.7

* - removed sorting by size for getting list of files method
- data param for dateTimeUploadedASC ordering is optional now

* removed rekognitionInfo from File model

* removed imageInfo from File model

* removed videoInfo from File model

* warning

* metadata added to File model

* docs

* order

* Improvements for handling responses in RequestManager

* Added methods for REST API to get/update/delete File metadata

* store group method is not available for REST API anymore

* use keyDecodingStrategy for decoders

* Revert "use keyDecodingStrategy for decoders"

This reverts commit d210ca2.

* added contentInfo property to File data model

* delete group method added for REST API

* models updated

* added FileInfoQuery to set request query to include appdata

* new models for AppData added

* refactoring

* appData field added for File model

* refactoring

* execute AWS recognition method added

* added method to check aws recognition status

* integration tests for aws recognition execution and and status check

* Added execution of ClamAV addon, checking it’s status and integration tests for it

* RemoveBGAddonExecutionParams model added

* remove.bg addon execution and status + refactoring

* integration tests for remove.bg addon methods

* done field added to UploadedFile model

* added contentInfo file to UploadedFile model

* added metadata property to UploadedFile model

* bump lib version

* metadata can be provided for upload from url method

* metadata can be provided for direct upload method

* metadata can be provided for multipart uploads

* set swift version 5.5

* demo app fixed

* updated project for carthage

* more swift versions

* podfile updated

* warning removed

* set lib version 0.9.0

* metadata param for main upload method

- metadata param for main upload method
- don’t get fileinfo if only public key provided after direct upload

integration test for direct upload when only public key provided

* pass metadata from UploadedFile when calling upload

* added integratin test for multipart uploading if only public key provided

* Update README.md

* Update REST API.md

* Update REST API.md

* Update REST API.md

* Update REST API.md

* Update Upload API.md

* Update README.md

* Update test.yml

* Update REST API.md

* Update REST API.md

* Update Upload API.md

* Update REST API.md

* Update REST API.md

* couple links updated

* test updated

* fixed parsing of UploadedFile model

* added new integration test to upload a video file and check that parsing of response works

* version bump

* spaces

* cleanup

* async tests file

* async version of getProjectInfo and test

* formatting

* async getListOfWebhooks and test

* async performRequest

* async webhooks methods

* refactoring

* refactoring

* async listOfGroups and groupInfo + tests

* async list of files and tests

* one more test

* async pagination for list of files

* async fileinfo and test

* error handling

* refactoring

* refactoring

* async groups list and pagination + tests

* Equatable conformance

* Equatable for Group and check results in test

* async getAuthenticatedUrlFromUrl and test

* UploadAPIIntegrationAsyncTests

* async directUploadInForeground and test

* async deleteFile and test

* async deleteFiles and test

* async storeFile and test

* async storeFiles and test

* async copyFileToLocalStorage and test

* async copyFileToRemoteStorage and test

* async convertDocuments, convertDocumentsWithSettings, documentConversionJobStatus and tests

* async convertVideosWithSettings, convertVideos, videoConversionJobStatus and tests

* …

* async methods for metadata and test

* Async methods for AWS recognition and test

* Async methods for Clamav addon and test

* async methods for Remove.bg addon and tests

* async deleteGroup method

* refactoring

* async methods for upload from url and it’s status and test

* warning fixed

* async fileInfo and test

* updated unsplash link

* tests refactoring

* async multipart upload and test

* test improved

* uploadSignature param for directUploadInForeground

* async uploadFile method in Uploadcare class + test

* docs

* async upload method for UploadedFile class and test

* test updated

* async methods to create groups + tests

* tests renames

* cleanup

* tests annotation

* fixed build for tvOS

* annotation

* fixed build for watchOS

* tests are available for watchOS too

* …

* documentation updated

* docs

* docs

* docs

* docs

* docs

* spaces

* docs

* docs

* docs

* docs

* docs

* docs

* docs

* docs

* readme

* update semf

* demo app refactoring

* async

* refactoring

* more async methods

* dead link

* more async

* widget updated to fix a warning

* use new AsyncImage in widget

* warning fixed

* cleanup

* async files load in demo app

* discardableResult

* async file delete in demo

* demo app project updated

* readme updated

* docs updated

* docs updated

* test updated

* docs with examples

* docs

* docs

* docs

* docs

* REST API docs

* docs

* docs

* couple fixes

* uploadAndWaitForCompletion method and test added

* docs

* bump lib version

* podspec updated

* updated carthage project

* Update README.md

* bump version to 0.10.0

* podspec updated

* Update test.yml

* Linux support (#111)

* wip

* dependencies for Linux

* package version

* nsec

* wip

* wip

* wip

* wip

* commented code that breaks building for linux

* use apple's Crypto

* sha1 and sha256 implementations using Crypto

* AsyncHTTPClient for requests

* Package.reslolved

* wip

* empty line

* wip

* disable tests for methods with callbacks for LInux

* disable CI for PRs to develop for now

* wip

* wip

* wip

* removed force unwrapping in tests

* return Data from request if need

* directUploadInForeground for Linux

* space

* default store value - auto

* multipart upload for Linux

* fix

* fixes

* no need to delete headers

* added testing on Ubuntu in workflow

* Update test.yml

* Update test.yml

* swift-tools-version:5.6

---------

Co-authored-by: Sergei Armodin <dolph-in@yandex.ru~>

* version bump

---------

Co-authored-by: Ivan Tse <github@nerdtower.com>
Co-authored-by: Roman Sedykh <rsedykh@gmail.com>
Co-authored-by: Sergei Armodin <dolph-in@yandex.ru~>
  • Loading branch information
4 people committed Sep 5, 2023
1 parent 43b6a3b commit 84148eb
Show file tree
Hide file tree
Showing 33 changed files with 596 additions and 83 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ on:
branches: [ master, develop ]

jobs:
SwiftBuild:
macos_build_and_test:
name: Build and test on latest macOS
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@master

- name: Swift build for iOS
run: swift build -c release -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios13.0-simulator"
Expand All @@ -23,15 +24,33 @@ jobs:
- name: Swift test
run: UPLOADCARE_PUBLIC_KEY="${{ secrets.UPLOADCARE_PUBLIC_KEY }}" UPLOADCARE_SECRET_KEY="${{ secrets.UPLOADCARE_SECRET_KEY }}" swift test

CarthageBuild:
ubuntu:
name: Build and test on latest Ubuntu
runs-on: ubuntu-latest
strategy:
matrix:
swift: [5.8.1, 5.7.3, 5.6.3]

steps:
- name: Checkout
uses: actions/checkout@master

- name: Swift build
run: swift build -c release

- name: Swift test
run: UPLOADCARE_PUBLIC_KEY="${{ secrets.UPLOADCARE_PUBLIC_KEY }}" UPLOADCARE_SECRET_KEY="${{ secrets.UPLOADCARE_SECRET_KEY }}" swift test

carthage:
name: Build Carthage targets on latest macOS
runs-on: macos-latest
strategy:
matrix:
target: ['Uploadcare', 'Uploadcare-tvOS', 'Uploadcare-macOS', 'Uploadcare-watchOS']

steps:
- name: Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@master

- name: Build Carthage target ${{matrix.target}}
run: xcodebuild build -project Uploadcare.xcodeproj -scheme ${{matrix.target}} -configuration Release
97 changes: 97 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"object": {
"pins": [
{
"package": "async-http-client",
"repositoryURL": "https://github.com/swift-server/async-http-client.git",
"state": {
"branch": null,
"revision": "78db67e5bf4a8543075787f228e8920097319281",
"version": "1.18.0"
}
},
{
"package": "swift-atomics",
"repositoryURL": "https://github.com/apple/swift-atomics.git",
"state": {
"branch": null,
"revision": "6c89474e62719ddcc1e9614989fff2f68208fe10",
"version": "1.1.0"
}
},
{
"package": "swift-collections",
"repositoryURL": "https://github.com/apple/swift-collections.git",
"state": {
"branch": null,
"revision": "937e904258d22af6e447a0b72c0bc67583ef64a2",
"version": "1.0.4"
}
},
{
"package": "swift-crypto",
"repositoryURL": "https://github.com/apple/swift-crypto.git",
"state": {
"branch": null,
"revision": "60f13f60c4d093691934dc6cfdf5f508ada1f894",
"version": "2.6.0"
}
},
{
"package": "swift-log",
"repositoryURL": "https://github.com/apple/swift-log.git",
"state": {
"branch": null,
"revision": "532d8b529501fb73a2455b179e0bbb6d49b652ed",
"version": "1.5.3"
}
},
{
"package": "swift-nio",
"repositoryURL": "https://github.com/apple/swift-nio.git",
"state": {
"branch": null,
"revision": "cf281631ff10ec6111f2761052aa81896a83a007",
"version": "2.58.0"
}
},
{
"package": "swift-nio-extras",
"repositoryURL": "https://github.com/apple/swift-nio-extras.git",
"state": {
"branch": null,
"revision": "0e0d0aab665ff1a0659ce75ac003081f2b1c8997",
"version": "1.19.0"
}
},
{
"package": "swift-nio-http2",
"repositoryURL": "https://github.com/apple/swift-nio-http2.git",
"state": {
"branch": null,
"revision": "a8ccf13fa62775277a5d56844878c828bbb3be1a",
"version": "1.27.0"
}
},
{
"package": "swift-nio-ssl",
"repositoryURL": "https://github.com/apple/swift-nio-ssl.git",
"state": {
"branch": null,
"revision": "320bd978cceb8e88c125dcbb774943a92f6286e9",
"version": "2.25.0"
}
},
{
"package": "swift-nio-transport-services",
"repositoryURL": "https://github.com/apple/swift-nio-transport-services.git",
"state": {
"branch": null,
"revision": "e7403c35ca6bb539a7ca353b91cc2d8ec0362d58",
"version": "1.19.0"
}
}
]
},
"version": 1
}
54 changes: 36 additions & 18 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,35 +1,53 @@
// swift-tools-version:5.5
// swift-tools-version:5.6
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

#if os(Linux)
let dependencies: [PackageDescription.Package.Dependency] = [
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.18.0"),
.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "3.0.0")
]
let targetDependencies: [PackageDescription.Target.Dependency] = [
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "Crypto", package: "swift-crypto")
]
let products: [PackageDescription.Product] = [
.library(name: "Uploadcare", targets: ["Uploadcare"])
]
#else
let dependencies: [PackageDescription.Package.Dependency] = []
let targetDependencies: [PackageDescription.Target.Dependency] = []
let products: [PackageDescription.Product] = [
.library(name: "Uploadcare", targets: ["Uploadcare"]),
.library(name: "UploadcareWidget", targets: ["UploadcareWidget"])
]
#endif

let package = Package(
name: "Uploadcare",
name: "Uploadcare",
platforms: [
.macOS(.v10_13),
.iOS(.v11),
.tvOS(.v11),
.watchOS(.v5)
],
products: [
.library(name: "Uploadcare", targets: ["Uploadcare"]),
.library(name: "UploadcareWidget", targets: ["UploadcareWidget"])
],
dependencies: [],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "Uploadcare",
dependencies: []
],
products: products,
dependencies: dependencies,
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "Uploadcare",
dependencies: targetDependencies
),
.target(
name: "UploadcareWidget",
dependencies: ["Uploadcare"]
),
.testTarget(
name: "UploadcareTests",
dependencies: ["Uploadcare"]
.testTarget(
name: "UploadcareTests",
dependencies: ["Uploadcare"]
)
]
]
)
5 changes: 5 additions & 0 deletions Sources/Uploadcare/BackgroundSessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
//

import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

#if !os(Linux)
class BackgroundSessionManager: NSObject {
static let instance = BackgroundSessionManager()

Expand Down Expand Up @@ -57,3 +61,4 @@ extension BackgroundSessionManager: URLSessionTaskDelegate {
(sessionDelegate as? URLSessionDataDelegate)?.urlSession?(session, dataTask: dataTask, didReceive: data)
}
}
#endif
2 changes: 1 addition & 1 deletion Sources/Uploadcare/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal let RESTAPIHost = "api.uploadcare.com"
/// Library name
internal let libraryName = "UploadcareSwift"
/// Library version
internal let libraryVersion = "0.10.0"
internal let libraryVersion = "0.11.0"

/// API version
internal let APIVersion = "0.7"
3 changes: 3 additions & 0 deletions Sources/Uploadcare/MultipartRequestBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
//

import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

class MultipartRequestBuilder {
private var boundary = UUID().uuidString
Expand Down
Loading

0 comments on commit 84148eb

Please sign in to comment.