Skip to content

Commit 3ab0706

Browse files
makonirsedykhSergei Armodin
authored
0.13.0 (#127)
* 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 * swift-crypto 3.0.0 * marked audio property of ContentInfo as required * removed deprecated methods * Webhook model is updated * version property updated for Webhook model * event param for create and update webhook methods * one more test * docs updated * added saveInGroup param for convertDocuments methods * fixed Carthage project * added testing with Swift 5.9 on Ubuntu * version bump * sources list updated in widget * menu UI fixed * tests updated * widget refactoring * widget cookie fix * async getSourceChunk * async loadMore * async uploadFileFromPath * smaller list of sources * run tests on Ubuntu for minimum and maximum supported Swift versions only * formatting * added back OneDrive external source for widget * Demo app project updated * marked datetimeStored property as deprecated in Group and UploadedFilesGroup models * demo app updated * added defaultEffects to UploadedFile model * added defaultEffects to File model * tests updated * tests updated * var -> let for requestID * Added methods for AWS Rekognition Moderation Add-on and tests * refactoring * renamed: executeAWSRecognition -> executeAWSRekognition renamed: checkAWSRecognitionStatus -> checkAWSRekognitionStatus * docs updated * docs updated * Extracted Addons methods to a separate file * Timeout error added * performAWSRekognition method added + tests + docs * refactoring * docs * performAWSRekognitionModeration method + test + docs * performClamav method + test + docs * refactoring * docs * performRemoveBG method + test + docs * refactoring * tests updated * version bump * build fixed * build fix --------- Co-authored-by: Roman Sedykh <rsedykh@gmail.com> Co-authored-by: Sergei Armodin <dolph-in@yandex.ru~>
1 parent 5b298ea commit 3ab0706

35 files changed

+1080
-613
lines changed

Demo/Demo.xcodeproj/project.pbxproj

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 53;
6+
objectVersion = 56;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -253,7 +253,7 @@
253253
attributes = {
254254
BuildIndependentTargetsInParallel = YES;
255255
LastSwiftUpdateCheck = 1140;
256-
LastUpgradeCheck = 1430;
256+
LastUpgradeCheck = 1500;
257257
ORGANIZATIONNAME = "Uploadcare, Inc";
258258
TargetAttributes = {
259259
243A7125242CEAA200CA229B = {
@@ -262,7 +262,7 @@
262262
};
263263
};
264264
buildConfigurationList = 243A7121242CEAA200CA229B /* Build configuration list for PBXProject "Demo" */;
265-
compatibilityVersion = "Xcode 9.3";
265+
compatibilityVersion = "Xcode 14.0";
266266
developmentRegion = en;
267267
hasScannedForEncodings = 0;
268268
knownRegions = (
@@ -343,6 +343,7 @@
343343
isa = XCBuildConfiguration;
344344
buildSettings = {
345345
ALWAYS_SEARCH_USER_PATHS = NO;
346+
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
346347
CLANG_ANALYZER_NONNULL = YES;
347348
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
348349
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -376,6 +377,7 @@
376377
DEBUG_INFORMATION_FORMAT = dwarf;
377378
ENABLE_STRICT_OBJC_MSGSEND = YES;
378379
ENABLE_TESTABILITY = YES;
380+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
379381
GCC_C_LANGUAGE_STANDARD = gnu11;
380382
GCC_DYNAMIC_NO_PIC = NO;
381383
GCC_NO_COMMON_BLOCKS = YES;
@@ -404,6 +406,7 @@
404406
isa = XCBuildConfiguration;
405407
buildSettings = {
406408
ALWAYS_SEARCH_USER_PATHS = NO;
409+
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
407410
CLANG_ANALYZER_NONNULL = YES;
408411
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
409412
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -437,6 +440,7 @@
437440
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
438441
ENABLE_NS_ASSERTIONS = NO;
439442
ENABLE_STRICT_OBJC_MSGSEND = YES;
443+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
440444
GCC_C_LANGUAGE_STANDARD = gnu11;
441445
GCC_NO_COMMON_BLOCKS = YES;
442446
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;

Demo/Demo/Assets.xcassets/AppIcon.appiconset/Contents.json

+2-104
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,9 @@
11
{
22
"images" : [
3-
{
4-
"filename" : "icon_20pt@2x.png",
5-
"idiom" : "iphone",
6-
"scale" : "2x",
7-
"size" : "20x20"
8-
},
9-
{
10-
"filename" : "icon_20pt@3x.png",
11-
"idiom" : "iphone",
12-
"scale" : "3x",
13-
"size" : "20x20"
14-
},
15-
{
16-
"filename" : "icon_29pt@2x.png",
17-
"idiom" : "iphone",
18-
"scale" : "2x",
19-
"size" : "29x29"
20-
},
21-
{
22-
"filename" : "icon_29pt@3x.png",
23-
"idiom" : "iphone",
24-
"scale" : "3x",
25-
"size" : "29x29"
26-
},
27-
{
28-
"filename" : "icon_40pt@2x.png",
29-
"idiom" : "iphone",
30-
"scale" : "2x",
31-
"size" : "40x40"
32-
},
33-
{
34-
"filename" : "icon_40pt@3x.png",
35-
"idiom" : "iphone",
36-
"scale" : "3x",
37-
"size" : "40x40"
38-
},
39-
{
40-
"filename" : "icon_60pt@2x.png",
41-
"idiom" : "iphone",
42-
"scale" : "2x",
43-
"size" : "60x60"
44-
},
45-
{
46-
"filename" : "icon_60pt@3x.png",
47-
"idiom" : "iphone",
48-
"scale" : "3x",
49-
"size" : "60x60"
50-
},
51-
{
52-
"filename" : "icon_20pt.png",
53-
"idiom" : "ipad",
54-
"scale" : "1x",
55-
"size" : "20x20"
56-
},
57-
{
58-
"filename" : "icon_20pt@2x-1.png",
59-
"idiom" : "ipad",
60-
"scale" : "2x",
61-
"size" : "20x20"
62-
},
63-
{
64-
"filename" : "icon_29pt.png",
65-
"idiom" : "ipad",
66-
"scale" : "1x",
67-
"size" : "29x29"
68-
},
69-
{
70-
"filename" : "icon_29pt@2x-1.png",
71-
"idiom" : "ipad",
72-
"scale" : "2x",
73-
"size" : "29x29"
74-
},
75-
{
76-
"filename" : "icon_40pt.png",
77-
"idiom" : "ipad",
78-
"scale" : "1x",
79-
"size" : "40x40"
80-
},
81-
{
82-
"filename" : "icon_40pt@2x-1.png",
83-
"idiom" : "ipad",
84-
"scale" : "2x",
85-
"size" : "40x40"
86-
},
87-
{
88-
"filename" : "icon_76pt.png",
89-
"idiom" : "ipad",
90-
"scale" : "1x",
91-
"size" : "76x76"
92-
},
93-
{
94-
"filename" : "icon_76pt@2x.png",
95-
"idiom" : "ipad",
96-
"scale" : "2x",
97-
"size" : "76x76"
98-
},
99-
{
100-
"filename" : "icon_83.5@2x.png",
101-
"idiom" : "ipad",
102-
"scale" : "2x",
103-
"size" : "83.5x83.5"
104-
},
1053
{
1064
"filename" : "Icon.png",
107-
"idiom" : "ios-marketing",
108-
"scale" : "1x",
5+
"idiom" : "universal",
6+
"platform" : "ios",
1097
"size" : "1024x1024"
1108
}
1119
],
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Demo/Demo/Views/GroupsList/GroupRowView.swift

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ let jsonData = """
4646
{
4747
"id": "ec207006-882b-4184-8318-5b57ca2135d8~2",
4848
"datetime_created": "2020-05-05T18:52:14.481914Z",
49-
"datetime_stored": null,
5049
"files_count": 2,
5150
"cdn_url": "https://ucarecdn.com/ec207006-882b-4184-8318-5b57ca2135d8~2/",
5251
"url": "https://api.uploadcare.com/groups/ec207006-882b-4184-8318-5b57ca2135d8~2/"

Demo/Demo/Views/GroupsList/GroupView.swift

-7
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ struct GroupView: View {
3030
Text("\(viewData.group.datetimeCreated)")
3131
}
3232

33-
if viewData.group.datetimeStored != nil {
34-
VStack(alignment: .leading) {
35-
Text("Stored:").bold()
36-
Text("\(viewData.group.datetimeStored!)")
37-
}
38-
}
39-
4033
VStack(alignment: .leading) {
4134
Text("CDN URL:").bold()
4235
Text("\(viewData.group.cdnUrl)")

Documentation/REST API.md

+69-5
Original file line numberDiff line numberDiff line change
@@ -721,13 +721,13 @@ uploadcare.videoConversionJobStatus(token: 123456) { result in
721721
An Add-On is an application implemented by Uploadcare that accepts uploaded files as input and can produce other files and/or appdata as output.
722722

723723
### AWS Rekognition ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/awsRekognitionExecute))
724-
Execute AWS Rekognition Add-On for a given target to detect labels in an image. Note: Detected labels are stored in the file's appdata.
724+
Execute AWS Rekognition Add-On for a given target to detect labels in an image. **Note:** Detected labels are stored in the file's appdata.
725725
```swift
726726
// Async:
727-
let response = try await uploadcare.executeAWSRecognition(fileUUID: "uuid")
727+
let response = try await uploadcare.executeAWSRekognition(fileUUID: "uuid")
728728

729729
// With a completion callback:
730-
uploadcare.executeAWSRecognition(fileUUID: "uuid") { result in
730+
uploadcare.executeAWSRekognition(fileUUID: "uuid") { result in
731731
switch result {
732732
case .failure(let error):
733733
print(error)
@@ -740,10 +740,10 @@ uploadcare.executeAWSRecognition(fileUUID: "uuid") { result in
740740
Check status:
741741
```swift
742742
// Async:
743-
let status = try await uploadcare.checkAWSRecognitionStatus(requestID: response.requestID)
743+
let status = try await uploadcare.checkAWSRekognitionStatus(requestID: response.requestID)
744744

745745
// With a completion callback:
746-
uploadcare.checkAWSRecognitionStatus(requestID: "requestID") { result in
746+
uploadcare.checkAWSRekognitionStatus(requestID: "requestID") { result in
747747
switch result {
748748
case .failure(let error):
749749
print(error)
@@ -753,6 +753,51 @@ uploadcare.checkAWSRecognitionStatus(requestID: "requestID") { result in
753753
}
754754
```
755755

756+
Execute and wait for completion:
757+
```swift
758+
let status = try await uploadcare.performAWSRekognition(fileUUID: "uuid")
759+
print(status)
760+
```
761+
762+
### AWS Rekognition Moderation ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#tag/Add-Ons/operation/awsRekognitionDetectModerationLabelsExecute))
763+
Execute AWS Rekognition Moderation Add-On for a given target to detect moderation labels in an image. **Note:** Detected moderation labels are stored in the file's appdata.
764+
```swift
765+
// Async:
766+
let response = try await uploadcare.executeAWSRekognitionModeration(fileUUID: "uuid")
767+
768+
// With a completion callback:
769+
uploadcare.executeAWSRekognitionModeration(fileUUID: "uuid") { result in
770+
switch result {
771+
case .failure(let error):
772+
print(error)
773+
case .success(let response):
774+
print(response) // contains requestID
775+
}
776+
}
777+
```
778+
779+
Check status:
780+
```swift
781+
// Async:
782+
let status = try await uploadcare.checkAWSRekognitionModerationStatus(requestID: response.requestID)
783+
784+
// With a completion callback:
785+
uploadcare.checkAWSRekognitionModerationStatus(requestID: "requestID") { result in
786+
switch result {
787+
case .failure(let error):
788+
print(error)
789+
case .success(let status):
790+
print(status)
791+
}
792+
}
793+
```
794+
795+
Execute and wait for completion:
796+
```swift
797+
let status = try await uploadcare.performAWSRekognitionModeration(fileUUID: "uuid")
798+
print(status)
799+
```
800+
756801
### ClamAV ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/ucClamavVirusScanExecute))
757802
Execute ClamAV virus checking Add-On for a given target.
758803
```swift
@@ -788,6 +833,16 @@ uploadcare.checkClamAVStatus(requestID: "requestID") { result in
788833
}
789834
```
790835

836+
Execute and wait for completion:
837+
```swift
838+
let parameters = ClamAVAddonExecutionParams(purgeInfected: true)
839+
let status = try await uploadcare.performClamav(
840+
fileUUID: "fileUUID",
841+
parameters: parameters
842+
)
843+
print(status)
844+
```
845+
791846
### Remove.bg ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/removeBgExecute))
792847
Execute remove.bg background image removal Add-On for a given target.
793848
```swift
@@ -823,3 +878,12 @@ uploadcare.checkRemoveBGStatus(requestID: "requestID") { result in
823878
}
824879
}
825880
```
881+
882+
Execute and wait for completion:
883+
```swift
884+
// more parameters in RemoveBGAddonExecutionParams model
885+
let parameters = RemoveBGAddonExecutionParams(crop: true, typeLevel: .two)
886+
887+
let status = try await uploadcare.performRemoveBG(fileUUID: "uuid", parameters: parameters)
888+
print(status)
889+
```

Sources/Uploadcare/Constants.swift

+1-1
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.12.0"
22+
internal let libraryVersion = "0.13.0"
2323

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

0 commit comments

Comments
 (0)