Skip to content

Commit

Permalink
Update to API 0.7 (#104)
Browse files Browse the repository at this point in the history
* Remove utm that aren't working

* Update README.md

* integration test for file info upload API method

* refactoring

* tabs

* refactoring

* tabs

* tabs

* refactoring

* test fixed

* defaultError with status for UploadError

* pass RequestManager to UploadAPI

* separate validation methods for REST API and Upload API requests

* refactoring

* refactoring

* refactoring

* uploadStatus method updated

* formatting

* refactoring

* refactoring and fixes for integration tests

* integration test for multipart upload

* startMulipartUpload refactoring

* uploadIndividualFilePart refactoring

* completeMultipartUpload refactoring

* integratin tests for file groups added

* refactoring

* refactoring

* refactoring

* Alamofire is finally removed from dependencies

* cleanup

* Update test.yml

* tests refactoring

* tabs

* fixes

* tests accepts keys as arguments

* …

* Update test.yml

* Update test.yml

* pod version bump, removed Alamofire from dependencies

* removed Alamofire from Carthage dependencies

* Carthage project updated

* try to remove Cartfile

* Revert "try to remove Cartfile"

This reverts commit 7125783.

* build library for distribution

* …

* tabs

* test updated

* wip

* more methods implemented with Result type

* wip

* wip

* wip

* wip

* refactoring

* refactoring

* refactoring

* wip

* 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 <[email protected]>

* Update README.md

Co-authored-by: Roman Sedykh <[email protected]>

* Update Documentation/Upload API.md

Co-authored-by: Roman Sedykh <[email protected]>

* 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 <[email protected]>

* Update Documentation/REST API.md

Co-authored-by: Roman Sedykh <[email protected]>

* Update Documentation/Upload API.md

Co-authored-by: Roman Sedykh <[email protected]>

* Update Documentation/Upload API.md

Co-authored-by: Roman Sedykh <[email protected]>

* Update README.md

Co-authored-by: Roman Sedykh <[email protected]>

* Update README.md

Co-authored-by: Roman Sedykh <[email protected]>

* 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

Co-authored-by: Roman Sedykh <[email protected]>
Co-authored-by: Ivan Tse <[email protected]>
  • Loading branch information
3 people authored Oct 20, 2022
1 parent 68abc7e commit d16065b
Show file tree
Hide file tree
Showing 42 changed files with 2,583 additions and 989 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Build and test

on:
push:
branches: [ master, develop ]
# push:
# branches: [ master, develop ]
pull_request:
branches: [ master, develop ]

Expand Down
43 changes: 1 addition & 42 deletions Demo/Demo/Views/FilesList/FileRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct FileRowView: View {
Image(systemName: "photo.fill")
.frame(width: 30, height: 30, alignment: .center)
}
} else if fileData.file.videoInfo != nil {
} else if fileData.file.contentInfo?.video != nil {
Image(systemName: "video.fill")
.frame(width: 30, height: 30, alignment: .center)
} else {
Expand Down Expand Up @@ -65,44 +65,3 @@ struct FileRowView: View {
}
}
}

struct FileRowView_Previews: PreviewProvider {
static var previews: some View {
#if DEBUG
FileRowView(fileData: testFileViewData)
.previewLayout(.sizeThatFits)
#endif
}
}

#if DEBUG
let testFile = File(
size: 54306,
uuid: "d1a13e8a-eb9a-4782-b828-e561adad2cf1",
originalFilename: "random_file_name.jpg",
mimeType: "image/jpeg",
isImage: true,
isReady: true,
datetimeRemoved: nil,
datetimeStored: nil,
datetimeUploaded: Date(),
originalFileUrl: "https://ucarecdn.com/d1a13e8a-eb9a-4782-b828-e561adad2cf1/random_file_name.jpg",
url: "https://api.uploadcare.com/files/d1a13e8a-eb9a-4782-b828-e561adad2cf1/",
source: nil,
variations: nil,
rekognitionInfo: nil,
imageInfo: ImageInfo(
height: 2002,
width: 3000,
geoLocation: nil,
datetimeOriginal: nil,
format: "JPEG",
colorMode: .RGB,
dpi: [72, 72],
orientation: 1,
sequence: false
),
videoInfo: nil
)
let testFileViewData = FileViewData(file: testFile)
#endif
24 changes: 5 additions & 19 deletions Demo/Demo/Views/FilesList/FileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ struct FileView: View {
VStack(alignment: .leading, spacing: 12) {
Text("\(self.fileData.file.originalFilename)")
.bold()
if self.fileData.file.imageInfo?.width != nil && self.fileData.file.imageInfo?.height != nil {

if let width = self.fileData.file.contentInfo?.image?.width, let height = self.fileData.file.contentInfo?.image?.height {
VStack(alignment: .leading) {
Text("Size:").bold()
Text("\(self.fileData.file.imageInfo!.width)x\(self.fileData.file.imageInfo!.height) | \(self.fileData.file.size / 1024) kb")
Text("\(width)x\(height) | \(self.fileData.file.size / 1024) kb")
}
} else if self.fileData.file.videoInfo?.video.width != nil && self.fileData.file.videoInfo?.video.height != nil {
} else if let width = self.fileData.file.contentInfo?.video?.video.first?.width, let height = self.fileData.file.contentInfo?.video?.video.first?.height {
VStack(alignment: .leading) {
Text("Size:").bold()
Text("\(self.fileData.file.videoInfo!.video.width)x\(self.fileData.file.videoInfo!.video.height) | \(self.fileData.file.size / 1024) kb")
Text("\(width)x\(height) | \(self.fileData.file.size / 1024) kb")
}
} else {
VStack(alignment: .leading) {
Expand Down Expand Up @@ -143,17 +143,3 @@ struct FileView: View {
}
}
}

struct FileView_Previews: PreviewProvider {
static var previews: some View {
#if DEBUG
NavigationView {
FileView(fileData: testFileViewData)
}
#endif
}
}




Loading

0 comments on commit d16065b

Please sign in to comment.