Skip to content

Commit ccf7802

Browse files
Merge pull request #16 from contentstack/next
Azure EU Region and Include Metadata Support added
2 parents ff830c4 + 64b051c commit ccf7802

17 files changed

+93
-46
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CONTENTSTACK_SDK_VERSION=1.4.0
1+
CONTENTSTACK_SDK_VERSION=1.5.0

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
restore-keys: |
2121
${{ runner.os }}-carthage-
2222
- name: Dependencies
23-
run: carthage bootstrap --no-use-binaries --platform macOS --cache-builds
23+
run: carthage bootstrap --no-use-binaries --platform macOS
2424
- name: Dependency libxml2
2525
run: brew install libxml2 && brew link --force libxml2
2626
- name: macOS
@@ -32,7 +32,7 @@ jobs:
3232
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
3333
strategy:
3434
matrix:
35-
destination: ["OS=14.4,name=iPhone 13 Pro"]
35+
destination: ["OS=16.2,name=iPhone 14 Pro"]
3636
steps:
3737
- uses: actions/checkout@v1
3838
with:
@@ -41,7 +41,7 @@ jobs:
4141
restore-keys: |
4242
${{ runner.os }}-carthage-
4343
- name: Dependencies
44-
run: carthage bootstrap --no-use-binaries --platform iOS --cache-builds
44+
run: carthage bootstrap --no-use-binaries --platform iOS --use-xcframeworks
4545
- name: iOS - ${{ matrix.destination }}
4646
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Contentstack.xcworkspace" -scheme "Contentstack iOS" SWIFT_ACTIVE_COMPILATION_CONDITIONS="NO_FATAL_TEST" -destination "${{ matrix.destination }}" test | xcpretty
4747

@@ -52,7 +52,7 @@ jobs:
5252
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
5353
strategy:
5454
matrix:
55-
destination: ["OS=14.3,name=Apple TV 4K"]
55+
destination: ["OS=16.1,name=Apple TV 4K (2nd generation)"]
5656
steps:
5757
- uses: actions/checkout@v1
5858
with:
@@ -61,7 +61,7 @@ jobs:
6161
restore-keys: |
6262
${{ runner.os }}-carthage-
6363
- name: Dependencies
64-
run: carthage bootstrap --no-use-binaries --platform tvOS --cache-builds
64+
run: carthage bootstrap --no-use-binaries --platform tvOS --use-xcframeworks
6565
- name: tvOS - ${{ matrix.destination }}
6666
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Contentstack.xcworkspace" -scheme "Contentstack tvOS" SWIFT_ACTIVE_COMPILATION_CONDITIONS="NO_FATAL_TEST" -destination "${{ matrix.destination }}" test | xcpretty
6767

@@ -72,7 +72,7 @@ jobs:
7272
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
7373
strategy:
7474
matrix:
75-
destination: ["OS=7.2,name=Apple Watch Series 6 - 44mm"]
75+
destination: ["OS=9.1,name=Apple Watch Series 6 (44mm)"]
7676
steps:
7777
- uses: actions/checkout@v1
7878
with:

.talismanrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
fileignoreconfig:
2+
- filename: Contentstack.xcworkspace/xcshareddata/xcschemes/Contentstack macOS.xcscheme
3+
checksum: 0f51b502dfb1608309256d8d7afa1395bb7cc7e1f7e7b46ea0843f86672c59b5
4+
- filename: Contentstack.xcworkspace/xcshareddata/xcschemes/Contentstack iOS.xcscheme
5+
checksum: cb6f7774ef344bb8515d7a78b25efb34851471553962307da851d4f8176fa9c0
6+
- filename: Contentstack.xcworkspace/xcshareddata/xcschemes/Contentstack tvOS.xcscheme
7+
checksum: 6c9a15e0e7fee2536ccf2dc5370a2a46a7f90982ca1e59f908c38e105ff7ad8a
8+
- filename: Contentstack.xcworkspace/xcshareddata/xcschemes/Contentstack watchOS.xcscheme
9+
checksum: 414cf3b35c657684877ed8fe4e1a1a01f641df6f44ce4e8960c97c3d9b595a2c
10+
- filename: Sources/Decodable.swift
11+
checksum: 45760eb1b21207395da2b631bb85049b300d399f20f59a79cfdc181a5d6b07f3
12+
- filename: Contentstack.xcodeproj/project.pbxproj
13+
checksum: 5e73942ffcdf6031c37e1167029a89522dbb936e7292a08033db6b3f95c63d2c
14+
- filename: Sources/ContentstackConfig.swift
15+
checksum: fdb57e110cb65443e853f0d79ced1e80427d0d1720d21309aa8c87984ea5fac5
216
- filename: Tests/DVRRecordings/Asset.json
317
checksum: a1c17f932d0b00df127851f50456923546ee912ba9b4d60d1f244768d61b858d
418
- filename: Tests/DVRRecordings/SyncTest.json
519
checksum: e5148d9f58da7689f249969c25a0c36d6d9f26be062a2c6bd9aaf389118f0039
20+
21+
22+
623
threshold: medium

Config.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CONTENTSTACK_SDK_VERSION = 1.4.0
1+
CONTENTSTACK_SDK_VERSION = 1.5.0

Contentstack.xcodeproj/project.pbxproj

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,6 @@
756756
0F4A75C7241BAC4300E3A024 /* Sources */,
757757
0F4A75C8241BAC4300E3A024 /* Frameworks */,
758758
0F4A75C9241BAC4300E3A024 /* Resources */,
759-
0FFA5D6D241F63FB003B3AF5 /* ShellScript */,
760759
);
761760
buildRules = (
762761
);
@@ -1030,26 +1029,6 @@
10301029
};
10311030
/* End PBXResourcesBuildPhase section */
10321031

1033-
/* Begin PBXShellScriptBuildPhase section */
1034-
0FFA5D6D241F63FB003B3AF5 /* ShellScript */ = {
1035-
isa = PBXShellScriptBuildPhase;
1036-
buildActionMask = 2147483647;
1037-
files = (
1038-
);
1039-
inputFileListPaths = (
1040-
);
1041-
inputPaths = (
1042-
);
1043-
outputFileListPaths = (
1044-
);
1045-
outputPaths = (
1046-
);
1047-
runOnlyForDeploymentPostprocessing = 0;
1048-
shellPath = /bin/sh;
1049-
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n\n";
1050-
};
1051-
/* End PBXShellScriptBuildPhase section */
1052-
10531032
/* Begin PBXSourcesBuildPhase section */
10541033
0F4A75C7241BAC4300E3A024 /* Sources */ = {
10551034
isa = PBXSourcesBuildPhase;
@@ -1980,7 +1959,7 @@
19801959
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
19811960
SWIFT_VERSION = 5.0;
19821961
TARGETED_DEVICE_FAMILY = 3;
1983-
TVOS_DEPLOYMENT_TARGET = 10.0;
1962+
TVOS_DEPLOYMENT_TARGET = 11.0;
19841963
VERSIONING_SYSTEM = "apple-generic";
19851964
VERSION_INFO_PREFIX = "";
19861965
WATCHOS_DEPLOYMENT_TARGET = 2.0;
@@ -2053,7 +2032,7 @@
20532032
SUPPORTED_PLATFORMS = "appletvsimulator appletvos";
20542033
SWIFT_VERSION = 5.0;
20552034
TARGETED_DEVICE_FAMILY = 3;
2056-
TVOS_DEPLOYMENT_TARGET = 10.0;
2035+
TVOS_DEPLOYMENT_TARGET = 11.0;
20572036
VALIDATE_PRODUCT = YES;
20582037
VERSIONING_SYSTEM = "apple-generic";
20592038
VERSION_INFO_PREFIX = "";

ContentstackSwift.podspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ Pod::Spec.new do |s|
3333
s.social_media_url = 'https://twitter.com/Contentstack'
3434
s.swift_version = '5'
3535

36-
s.ios.deployment_target = '10.10'
37-
s.osx.deployment_target = '10.12'
38-
s.watchos.deployment_target = '3.0'
39-
s.tvos.deployment_target = '10.0'
36+
s.ios.deployment_target = '11.0'
37+
s.osx.deployment_target = '10.13'
38+
s.watchos.deployment_target = '4.0'
39+
s.tvos.deployment_target = '11.0'
4040

4141

4242
s.source_files = 'Sources/**/*'
4343

4444
# s.public_header_files = 'Pod/Classes/**/*.h'
4545
# s.frameworks = 'UIKit'
46-
s.dependency 'ContentstackUtils', '~> 1.2.0'
46+
s.dependency 'ContentstackUtils', '~> 1.3.0'
4747
end
4848

Package.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33

44
import PackageDescription
55

6+
7+
68
let package = Package(
79
name: "ContentstackSwift",
8-
platforms: [.macOS(.v10_12),
9-
.iOS(.v10),
10-
.tvOS(.v10),
11-
.watchOS(.v3)],
10+
platforms: [.macOS(.v10_13),
11+
.iOS(.v11),
12+
.tvOS(.v11),
13+
.watchOS(.v4)],
1214

1315
products: [
1416
// Products define the executables and libraries produced by a package, and make them visible to other packages.
@@ -18,7 +20,7 @@ let package = Package(
1820
],
1921
dependencies: [
2022
// Dependencies declare other packages that this package depends on.
21-
.package(url: "https://github.com/contentstack/contentstack-utils-swift.git", from: "1.2.0"),
23+
.package(url: "https://github.com/contentstack/contentstack-utils-swift.git", from: "1.3.0"),
2224
// Dev dependencies
2325
.package(url: "https://github.com/venmo/DVR.git", from: "2.1.0")
2426
],

Scripts/run-test-cases.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ xcodebuild \
3838
-scheme "Contentstack iOS" \
3939
-enableCodeCoverage YES \
4040
test \
41-
-destination "OS=16.0,name=iPhone 14" \
41+
-destination "OS=16.2,name=iPhone 14" \
4242
-resultBundlePath "$TEST_BUNDLE_PATH/$FILE_NAME-iOS.xcresult" \
4343
| xcpretty \
4444
--color \

Sources/Asset.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,30 @@ public class Asset: CachePolicyAccessible {
126126
return self
127127
}
128128

129+
130+
/// To include the metadata in the response.
131+
/// - Returns: A `Asset` to enable chaining.
132+
///
133+
/// Example usage:
134+
/// ```
135+
/// let stack = Contentstack.stack(apiKey: apiKey,
136+
/// deliveryToken: deliveryToken,
137+
/// environment: environment)
138+
///
139+
/// // To retrive single asset with dimension
140+
/// stack.asset(uid: assetUID).includeMetadata()
141+
/// .fetch { (result: Result<AssetModel, Error>, response: ResponseType) in
142+
/// switch result {
143+
/// case .success(let model):
144+
/// //Model retrive from API
145+
/// case .failure(let error):
146+
/// //Error Message
147+
/// }
148+
/// }
149+
public func includeMetadata() -> Asset {
150+
self.parameters[QueryParameter.includeMetadata] = true
151+
return self
152+
}
129153
/// To fetch all or find Assets `query` method is used.
130154
///
131155
/// - Returns: A `AssetQuery` to enable chaining.

Sources/CSDefinitions.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public enum ContentstackRegion: String {
3636
case eu = "eu"
3737
/// This region is for AZURE-NA Cloud
3838
case azure_na = "azure-na"
39+
/// This region is for AZURE-EU Cloud
40+
case azure_eu = "azure-eu"
3941
}
4042
/// The cache policies allow you to define the source from where the SDK will retrieve the content.
4143
public enum CachePolicy {

0 commit comments

Comments
 (0)