Skip to content

Commit 84148eb

Browse files
makoniivantsersedykhSergei Armodin
authored
0.11.0 (#112)
* 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~>
1 parent 43b6a3b commit 84148eb

33 files changed

+596
-83
lines changed

.github/workflows/test.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ on:
77
branches: [ master, develop ]
88

99
jobs:
10-
SwiftBuild:
10+
macos_build_and_test:
11+
name: Build and test on latest macOS
1112
runs-on: macos-latest
1213

1314
steps:
1415
- name: Checkout
15-
uses: actions/checkout@v3.5.3
16+
uses: actions/checkout@master
1617

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

26-
CarthageBuild:
27+
ubuntu:
28+
name: Build and test on latest Ubuntu
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
swift: [5.8.1, 5.7.3, 5.6.3]
33+
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@master
37+
38+
- name: Swift build
39+
run: swift build -c release
40+
41+
- name: Swift test
42+
run: UPLOADCARE_PUBLIC_KEY="${{ secrets.UPLOADCARE_PUBLIC_KEY }}" UPLOADCARE_SECRET_KEY="${{ secrets.UPLOADCARE_SECRET_KEY }}" swift test
43+
44+
carthage:
45+
name: Build Carthage targets on latest macOS
2746
runs-on: macos-latest
2847
strategy:
2948
matrix:
3049
target: ['Uploadcare', 'Uploadcare-tvOS', 'Uploadcare-macOS', 'Uploadcare-watchOS']
3150

3251
steps:
3352
- name: Checkout
34-
uses: actions/checkout@v3.5.3
35-
53+
uses: actions/checkout@master
54+
3655
- name: Build Carthage target ${{matrix.target}}
3756
run: xcodebuild build -project Uploadcare.xcodeproj -scheme ${{matrix.target}} -configuration Release

Package.resolved

Lines changed: 97 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,53 @@
1-
// swift-tools-version:5.5
1+
// swift-tools-version:5.6
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

6+
#if os(Linux)
7+
let dependencies: [PackageDescription.Package.Dependency] = [
8+
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.18.0"),
9+
.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "3.0.0")
10+
]
11+
let targetDependencies: [PackageDescription.Target.Dependency] = [
12+
.product(name: "AsyncHTTPClient", package: "async-http-client"),
13+
.product(name: "Crypto", package: "swift-crypto")
14+
]
15+
let products: [PackageDescription.Product] = [
16+
.library(name: "Uploadcare", targets: ["Uploadcare"])
17+
]
18+
#else
19+
let dependencies: [PackageDescription.Package.Dependency] = []
20+
let targetDependencies: [PackageDescription.Target.Dependency] = []
21+
let products: [PackageDescription.Product] = [
22+
.library(name: "Uploadcare", targets: ["Uploadcare"]),
23+
.library(name: "UploadcareWidget", targets: ["UploadcareWidget"])
24+
]
25+
#endif
26+
627
let package = Package(
7-
name: "Uploadcare",
28+
name: "Uploadcare",
829
platforms: [
930
.macOS(.v10_13),
1031
.iOS(.v11),
1132
.tvOS(.v11),
1233
.watchOS(.v5)
13-
],
14-
products: [
15-
.library(name: "Uploadcare", targets: ["Uploadcare"]),
16-
.library(name: "UploadcareWidget", targets: ["UploadcareWidget"])
17-
],
18-
dependencies: [],
19-
targets: [
20-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
21-
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
22-
.target(
23-
name: "Uploadcare",
24-
dependencies: []
34+
],
35+
products: products,
36+
dependencies: dependencies,
37+
targets: [
38+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
39+
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
40+
.target(
41+
name: "Uploadcare",
42+
dependencies: targetDependencies
2543
),
2644
.target(
2745
name: "UploadcareWidget",
2846
dependencies: ["Uploadcare"]
2947
),
30-
.testTarget(
31-
name: "UploadcareTests",
32-
dependencies: ["Uploadcare"]
48+
.testTarget(
49+
name: "UploadcareTests",
50+
dependencies: ["Uploadcare"]
3351
)
34-
]
52+
]
3553
)

Sources/Uploadcare/BackgroundSessionManager.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
//
88

99
import Foundation
10+
#if canImport(FoundationNetworking)
11+
import FoundationNetworking
12+
#endif
1013

14+
#if !os(Linux)
1115
class BackgroundSessionManager: NSObject {
1216
static let instance = BackgroundSessionManager()
1317

@@ -57,3 +61,4 @@ extension BackgroundSessionManager: URLSessionTaskDelegate {
5761
(sessionDelegate as? URLSessionDataDelegate)?.urlSession?(session, dataTask: dataTask, didReceive: data)
5862
}
5963
}
64+
#endif

Sources/Uploadcare/Constants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal let RESTAPIHost = "api.uploadcare.com"
1919
/// Library name
2020
internal let libraryName = "UploadcareSwift"
2121
/// Library version
22-
internal let libraryVersion = "0.10.0"
22+
internal let libraryVersion = "0.11.0"
2323

2424
/// API version
2525
internal let APIVersion = "0.7"

Sources/Uploadcare/MultipartRequestBuilder.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
//
88

99
import Foundation
10+
#if canImport(FoundationNetworking)
11+
import FoundationNetworking
12+
#endif
1013

1114
class MultipartRequestBuilder {
1215
private var boundary = UUID().uuidString

0 commit comments

Comments
 (0)