Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added variants implementation #38

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a9f24d5
Update License year in License and Readme
uttamukkoji Feb 1, 2024
fe07b55
feat: added gcp_na region
abhinav-from-contentstack May 13, 2024
a8877eb
fix: updated package version
abhinav-from-contentstack May 14, 2024
51cf937
fix: failing workflow
abhinav-from-contentstack May 17, 2024
cd04902
Merge branch 'master' into fix/dx-563-1
abhinav-from-contentstack May 17, 2024
9e739b4
fix: failing workflow
abhinav-from-contentstack May 17, 2024
5e70a5f
fix: updated workflow
abhinav-from-contentstack May 17, 2024
dc7ba07
feat: added variants implementation
dudeman9801 Jun 28, 2024
43e1a90
Update Contentstack.podspec
abhinav-from-contentstack Aug 23, 2024
aa9d87b
Merge branch 'master' into feat/dx-747
sunil-lakshman Sep 2, 2024
34c5d1f
WIP: fixing build issues
abhinav-from-contentstack Sep 4, 2024
d9b556d
Merge branch 'master' into feat/dx-747
abhinav-from-contentstack Sep 4, 2024
6a804cc
fix: entry parsing issue
Sep 4, 2024
9d2e014
Merge remote-tracking branch 'origin/feat/DX-200_clone' into feat/DX-…
Sep 4, 2024
3c59315
WIP: fixing tests
abhinav-from-contentstack Sep 10, 2024
ffa2558
Merge branch 'feat/dx-747' of github.com:contentstack/contentstack-io…
abhinav-from-contentstack Sep 10, 2024
1cd9cf0
Merge branch 'feat/DX-200_clone' into feat/dx-747
abhinav-from-contentstack Sep 10, 2024
a699de9
fix: updated tests
abhinav-from-contentstack Sep 13, 2024
79a17cc
fix: removed test testcase
abhinav-from-contentstack Sep 13, 2024
4b76a7e
fix: changed some test cases
Sep 15, 2024
ded6a46
Merge pull request #44 from contentstack/fix/retry-on-error
netrajpatel Sep 23, 2024
7b6e08d
Merge branch 'development' into feat/dx-85-gcp-support
Sep 23, 2024
d99d254
Merge pull request #45 from contentstack/feat/dx-85-gcp-support
netrajpatel Sep 23, 2024
dd0e0c1
testing for workflow
reeshika-h Sep 23, 2024
7d6df88
feat: added support for taxonomy
Aug 3, 2024
ae2510c
fix: updated tests to work with JS SDK test stack
abhinav-from-contentstack May 23, 2024
85ad2b5
Delete .github/workflows/sca-scan.yml
aravindbuilt Jun 10, 2024
0c120da
feat: added taxonomy initial support
Aug 6, 2024
9da1d8a
Update Contentstack.podspec
abhinav-from-contentstack Aug 23, 2024
f1bc273
Update License year in License and Readme
uttamukkoji Feb 1, 2024
90961a2
Merge pull request #46 from contentstack/fix/dx-563-1
netrajpatel Sep 23, 2024
ef8122f
Merge branch 'development' into feat/dx-747
Sep 23, 2024
3483bd3
merge changes reverted in project.pbxproj file
reeshika-h Sep 23, 2024
215cb44
fix: fixed test not running issue
Sep 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Build
run: |
# Add commands to build and test your package
xcodebuild -workspace Contentstack.xcworkspace -scheme 'Contentstack' -destination 'platform=iOS Simulator,name=iPhone 13 Pro'
xcodebuild -workspace Contentstack.xcworkspace -scheme 'Contentstack' -destination 'platform=iOS Simulator,name=iPhone 15'

- name: CocoaPods trunk push
run: pod trunk push --allow-warnings
Expand Down
8 changes: 6 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
fileignoreconfig:
- filename: Contentstack.xcodeproj/project.pbxproj
checksum: 331c4ff2e540e9495ff2a0d030ddd7f7c2eda077cb0b1a58c67fc2312b53658e
version: ""
checksum: 10cb4bc5ca755f7392309a88cd6df510a45f8c527ea2f8edc71e1ae1fda60941
- filename: .github/workflows/sast-scan.yml
checksum: 5554abc81d130557f52d64d253c3a23b41fcf0642a9c599131b2c185665ce581
- filename: PrivacyInfo.xcprivacy
checksum: 7697fa6a0a5e0600d35d4678ffff9ef14c5dff5dc1613d37968de7ded3ff1fd0
version: ""
2 changes: 1 addition & 1 deletion Contentstack.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ s.version = '3.13.0'
s.summary = 'Contentstack is a headless CMS with an API-first approach that puts content at the centre.'

s.description = <<-DESC
Contentstack is a headless CMS with an API-first approach that puts content at the centre. It is designed to simplify the process of publication by separating code from content.
Contentstack is a headless CMS with an API-first approach that puts content at the centre. It is designed to simplify the process of publication by separating code from content.
In a world where content is consumed via countless channels and form factors across mobile, web and IoT. Contentstack reimagines content management by decoupling code from content. Business users manage content – no training or development required. Developers can create cross-platform apps and take advantage of a headless CMS that delivers content through APIs. With an architecture that’s extensible – but without the bloat of legacy CMS – Contentstack cuts down on infrastructure, maintenance, cost and complexity.
DESC

Expand Down
206 changes: 147 additions & 59 deletions Contentstack.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1540"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Contentstack/Asset.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import <Foundation/Foundation.h>
#import "ContentstackDefinitions.h"
#import <Contentstack/ContentstackDefinitions.h>

BUILT_ASSUME_NONNULL_BEGIN

Expand Down
2 changes: 1 addition & 1 deletion Contentstack/AssetLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import <Foundation/Foundation.h>
#import "ContentstackDefinitions.h"
#import <Contentstack/ContentstackDefinitions.h>

BUILT_ASSUME_NONNULL_BEGIN

Expand Down
4 changes: 2 additions & 2 deletions Contentstack/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//

#import <Foundation/Foundation.h>
#import "ContentstackDefinitions.h"
#import "CSURLSessionDelegate.h"
#import <Contentstack/ContentstackDefinitions.h>
#import <Contentstack/CSURLSessionDelegate.h>
@interface Config : NSObject

/**----------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Contentstack/ContentType.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import <Foundation/Foundation.h>
#import "ContentstackDefinitions.h"
#import <Contentstack/ContentstackDefinitions.h>

@class Entry;
@class Query;
Expand Down
36 changes: 35 additions & 1 deletion Contentstack/Entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import <Foundation/Foundation.h>
#import "ContentstackDefinitions.h"
#import <Contentstack/ContentstackDefinitions.h>

@class Asset;
@class Group;
Expand Down Expand Up @@ -87,6 +87,10 @@ BUILT_ASSUME_NONNULL_BEGIN
* Readonly property to check deletedBy of entry
*/
@property (nonatomic, copy, readonly) NSString *deletedBy;
/**
* Readonly property to check deletedBy of entry
*/
@property (nonatomic, copy, readonly) NSMutableDictionary *localHeaders;


/**
Expand Down Expand Up @@ -124,6 +128,36 @@ BUILT_ASSUME_NONNULL_BEGIN
*/
- (void)setHeader:(NSString *)headerValue forKey:(NSString *)headerKey;

/**
Set a single variant uid as header

//'API_KEY' is a ENVIRONMENT Stack API key

//Obj-C
[entryObj variantUid:@"variantUid"];

//Swift
entryObj.variantUid("variantUid")

@param variantUid The variant uid
*/
- (void)variantUid:(NSString *)variantUid;

/**
Set multiple variant uids as header

//'API_KEY' is a ENVIRONMENT Stack API key

//Obj-C
[entryObj variantUids:@["variant1", "variant2"]];

//Swift
entryObj.setHeader(["variant1", "variant2"])

@param variantUids The variant uids
*/
- (void)variantUids:(NSArray *)variantUids;

/**
Set a header for Entry

Expand Down
11 changes: 11 additions & 0 deletions Contentstack/Entry.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ - (void)setHeader:(NSString *)headerValue forKey:(NSString *)headerKey {
[self.localHeaders setObject:headerValue forKey:headerKey];
}

- (void)variantUid:(NSString *)variantUid {
NSString *key = @"x-cs-variant-uid";
[self.localHeaders setObject:variantUid forKey: key];
}

- (void)variantUids:(NSArray *)variantUids {
NSString *key = @"x-cs-variant-uid";
NSString *joinedString = [variantUids componentsJoinedByString:@","];
[self.localHeaders setObject:joinedString forKey: key];
}

- (void)addHeadersWithDictionary:(NSDictionary<NSString *, NSString *> *)headers {
[headers enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
[self.localHeaders setObject:obj forKey:key];
Expand Down
2 changes: 1 addition & 1 deletion Contentstack/Group.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import <Foundation/Foundation.h>
#import "ContentstackDefinitions.h"
#import <Contentstack/ContentstackDefinitions.h>


@class Asset;
Expand Down
2 changes: 1 addition & 1 deletion Contentstack/Query.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import <Foundation/Foundation.h>
#import "ContentstackDefinitions.h"
#import <Contentstack/ContentstackDefinitions.h>

@class QueryResult;
@class Entry;
Expand Down
2 changes: 1 addition & 1 deletion Contentstack/QueryResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import <Foundation/Foundation.h>
#import "ContentstackDefinitions.h"
#import <Contentstack/ContentstackDefinitions.h>

BUILT_ASSUME_NONNULL_BEGIN

Expand Down
5 changes: 4 additions & 1 deletion Contentstack/QueryResult.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ - (NSInteger)totalCount {
// if condition is fix for value of "entries" key ie.array inside array in response JSON
if (objectsArray.firstObject && [objectsArray.firstObject isKindOfClass:[NSDictionary class]]) {
[objectsArray enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL * _Nonnull stop) {
Entry *formEntry = [self.taxonomy entry];
Entry *formEntry = [self.contentType entry];
if (formEntry == NULL) {
formEntry = [self.taxonomy entry];
}
[formEntry configureWithDictionary:obj];
[entryObjects addObject:formEntry];
}];
Expand Down
2 changes: 1 addition & 1 deletion Contentstack/Stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import <Foundation/Foundation.h>
#import "ContentstackDefinitions.h"
#import <Contentstack/ContentstackDefinitions.h>

@class Config;
@class ContentType;
Expand Down
2 changes: 1 addition & 1 deletion Contentstack/Taxonomy.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import <Foundation/Foundation.h>
#import "ContentstackDefinitions.h"
#import <Contentstack/ContentstackDefinitions.h>

@class Query;

Expand Down
Loading
Loading