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

Next : Early Access Support Added #93

Closed
wants to merge 126 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
7145da1
Merge pull request #50 from contentstack/azure-na
ishaileshmishra Mar 16, 2022
50f38f5
Snyk integration
contentstack-admin May 30, 2022
ed7f57a
adding snyk secrets
contentstack-admin May 30, 2022
b8085e6
adding sca-monitor
contentstack-admin May 30, 2022
5c5082b
create sca-scan
contentstack-admin May 30, 2022
a31e6d4
create sast-scan
contentstack-admin May 30, 2022
16fe5c5
Merge pull request #54 from contentstack/dev
ishaileshmishra Jun 1, 2022
024daf0
Update codeql-analysis.yml
contentstack-admin Jun 14, 2022
b33a812
Merge pull request #59 from contentstack/compilejava
ishaileshmishra Jun 16, 2022
a277071
fix: pom.xml to reduce vulnerabilities
snyk-bot Jun 16, 2022
f45e7d7
Update codeql-analysis.yml
aravindbuilt Aug 1, 2022
2019d2f
Delete sca-monitor.yml
aravindbuilt Aug 1, 2022
f66ddd9
Update sast-scan.yml
aravindbuilt Aug 1, 2022
9c52cff
Update sca-scan.yml
aravindbuilt Aug 1, 2022
bbce574
Update secrets-scan.yml
aravindbuilt Aug 1, 2022
74f796c
codeql-analysis.yml
aravindbuilt Sep 15, 2022
f2c3368
sast-scan.yml
aravindbuilt Sep 15, 2022
abbf664
sca-scan.yml
aravindbuilt Sep 15, 2022
a407d91
secrets-scan.yml
aravindbuilt Sep 15, 2022
a8cb70f
codeql-analysis.yml
aravindbuilt Sep 21, 2022
76b30bb
sast-scan.yml
aravindbuilt Sep 21, 2022
bcec2c5
sca-scan.yml
aravindbuilt Sep 21, 2022
b9ac217
secrets-scan.yml
aravindbuilt Sep 21, 2022
84ee49d
jira.yml
aravindbuilt Oct 3, 2022
728247f
jira.yml
aravindbuilt Oct 4, 2022
b1ffeff
Merge branch 'master' into dev
ishaileshmishra Oct 10, 2022
1337f6d
Merge branch 'dev' of https://github.com/contentstack/contentstack-ja…
ishaileshmishra Oct 20, 2022
3087b34
Live Preview
ishaileshmishra Oct 31, 2022
7b35deb
Live Preview
ishaileshmishra Oct 31, 2022
8896b6c
Live Preview
ishaileshmishra Oct 31, 2022
eae094f
Live Preview
ishaileshmishra Oct 31, 2022
ac25c8e
Live Preview
ishaileshmishra Oct 31, 2022
4459dfe
jira.yml
aravindbuilt Nov 4, 2022
9766476
:potted_plant: plugins support
ishaileshmishra Dec 8, 2022
324ad8c
:potted_plant: plugins support
ishaileshmishra Dec 8, 2022
7c6fd6a
Plugins implemented
ishaileshmishra Dec 9, 2022
3ed997c
:potted_plant: plugins support
ishaileshmishra Dec 9, 2022
71cbcf5
:potted_plant: CI/CD Pipeline
ishaileshmishra Dec 21, 2022
da0011e
sca-scan.yml
aravindbuilt Jan 24, 2023
b4b6a64
jira.yml
aravindbuilt Jan 24, 2023
c15b29c
codeql-analysis.yml
aravindbuilt Jan 24, 2023
8c418fd
sast-scan.yml
aravindbuilt Jan 24, 2023
d2b1574
secrets-scan.yml
aravindbuilt Jan 24, 2023
c27211b
:potted_plant: #67 error handling infinite loop issue
ishaileshmishra Feb 6, 2023
0f3a6ee
:potted_plant: #67 error handling infinite loop issue
ishaileshmishra Feb 6, 2023
a9074c1
Merge branch 'master' into plugins
ishaileshmishra Feb 7, 2023
4be4741
Merge branch 'master' into plugins
uttamukkoji Feb 7, 2023
0bdb775
:potted_plant: #67 resolved
ishaileshmishra Feb 8, 2023
3087a07
:potted_plant: #67 resolved
ishaileshmishra Feb 8, 2023
a72347d
Merge remote-tracking branch 'origin/plugins' into plugins
ishaileshmishra Feb 8, 2023
589d6e1
:potted_plant: #67 resolved
ishaileshmishra Feb 8, 2023
72e487f
:potted_plant: #67 resolved
ishaileshmishra Feb 8, 2023
2e31abf
:potted_plant: #67 pom.xml and CHANGELOG.md updated
ishaileshmishra Feb 8, 2023
4a27817
:potted_plant: LICENSE file updated
ishaileshmishra Feb 9, 2023
3c1d456
:potted_plant: LICENSE file updated
ishaileshmishra Feb 9, 2023
d32b954
Merge pull request #68 from contentstack/plugins
ishaileshmishra Feb 10, 2023
7021f39
feat/CS-35325-include_ownership
ishaileshmishra Apr 10, 2023
85014f7
feat/CS-37219-azure-eu-and-include-metadata
ishaileshmishra Apr 10, 2023
0d477be
Merge branch 'master' into feat/CS-37219-azure-eu-and-include-metadata
ishaileshmishra Apr 10, 2023
6e8c041
feat/CS-37219-azure-eu-and-include-metadata
ishaileshmishra Apr 11, 2023
1782cdd
feat/CS-37219-azure-eu-and-include-metadata
ishaileshmishra Apr 11, 2023
1d785c7
feat/cs-37219 azure-eu and include_metadata
ishaileshmishra Apr 18, 2023
6f72739
Merge pull request #74 from contentstack/feat/CS-37219-azure-eu-and-i…
ishaileshmishra Apr 18, 2023
60e400e
Create check-branch.yml
aravindbuilt Apr 18, 2023
9d3070a
CODEOWNERS update
aravindbuilt May 6, 2023
06b1ccd
cs-39681-Utils and dependencies update
ishaileshmishra Jun 19, 2023
007719e
Merge pull request #82 from contentstack/fix/CS-39681/utils-enhancement
ishaileshmishra Jun 19, 2023
ad2f8f7
Merge pull request #83 from contentstack/next
ishaileshmishra Jun 28, 2023
a156aa6
Utils update
ishaileshmishra Aug 8, 2023
8bfb574
Utils update
ishaileshmishra Aug 8, 2023
280bc9a
Utils update
ishaileshmishra Aug 9, 2023
7b48985
Utils update
ishaileshmishra Aug 9, 2023
730fcf9
run ci
ishaileshmishra Aug 9, 2023
030dfe4
run ci
ishaileshmishra Aug 9, 2023
5cb11d6
run ci
ishaileshmishra Aug 10, 2023
b8d0a86
run ci
ishaileshmishra Aug 10, 2023
2f0f3c9
run ci
ishaileshmishra Aug 10, 2023
c257e97
run ci
ishaileshmishra Aug 10, 2023
0082ce9
run ci
ishaileshmishra Aug 10, 2023
5bfbabe
run ci
ishaileshmishra Aug 10, 2023
d4e611e
run ci
ishaileshmishra Aug 10, 2023
b046eca
run ci
ishaileshmishra Aug 10, 2023
69e1bf7
run ci
ishaileshmishra Aug 10, 2023
ae97d85
run ci
ishaileshmishra Aug 10, 2023
f3ad4a6
run ci
ishaileshmishra Aug 10, 2023
02d6fa6
run ci
ishaileshmishra Aug 10, 2023
1d5e995
run ci
ishaileshmishra Aug 10, 2023
a7eb3bb
run ci
ishaileshmishra Aug 10, 2023
0c0f129
run ci
ishaileshmishra Aug 10, 2023
917854b
run ci
ishaileshmishra Aug 10, 2023
56ca186
GitHub Package Release
ishaileshmishra Aug 10, 2023
801ac63
GitHub Package Release
ishaileshmishra Aug 10, 2023
32e3ea8
GitHub Package Release
ishaileshmishra Aug 10, 2023
20b6651
GitHub Package Release
ishaileshmishra Aug 10, 2023
369b2f1
GitHub Package Release
ishaileshmishra Aug 10, 2023
87fa40c
GitHub Package Release
ishaileshmishra Aug 10, 2023
fff95fe
Merge pull request #86 from contentstack/enh/CS-39681-utils-sdk-v1.2.3
ishaileshmishra Aug 10, 2023
ba5e302
Merge branch 'master' into next
ishaileshmishra Aug 17, 2023
51c2765
tests fixed
ishaileshmishra Aug 17, 2023
5772e49
Merge pull request #87 from contentstack/next
ishaileshmishra Aug 18, 2023
7e04b9f
asset docs updated
ishaileshmishra Aug 18, 2023
d5f9bd4
updated pom.xml
ishaileshmishra Aug 18, 2023
5f38c5c
pom.xml updated
ishaileshmishra Aug 18, 2023
06235df
pom.xml updated to latest
ishaileshmishra Sep 18, 2023
a0b15dc
Utils SDK Updated to latest version
ishaileshmishra Sep 27, 2023
cd56c03
Merge branch 'master' into next
ishaileshmishra Sep 27, 2023
3fed846
Utils SDK Updated to latest version
ishaileshmishra Oct 3, 2023
f5046e0
Merge pull request #90 from contentstack/next
ishaileshmishra Oct 3, 2023
8a14765
v1.12.3 Early Access Feature Support
ishaileshmishra Nov 16, 2023
ba7a011
v1.12.3 Early Access Feature Support
ishaileshmishra Nov 16, 2023
05fae73
Merge branch 'master' into next
ishaileshmishra Nov 16, 2023
c02ae30
v1.12.3 Early Access Feature Support
ishaileshmishra Nov 16, 2023
5115af6
Merge remote-tracking branch 'origin/next' into next
ishaileshmishra Nov 16, 2023
07bdf9d
v1.12.3 Early Access Feature Support
ishaileshmishra Nov 16, 2023
0cbcb2f
v1.12.3
ishaileshmishra Dec 13, 2023
a046fa0
v1.12.3
ishaileshmishra Dec 13, 2023
fe28d6d
v1.12.3
ishaileshmishra Dec 13, 2023
f521de8
v1.12.3
ishaileshmishra Dec 14, 2023
2343fb9
v1.12.3
ishaileshmishra Dec 14, 2023
5539c4e
v1.12.3
ishaileshmishra Dec 14, 2023
5c0bf30
v1.12.3
ishaileshmishra Dec 15, 2023
5af4976
v1.12.3
ishaileshmishra Dec 15, 2023
74b6813
v1.12.3
ishaileshmishra Dec 15, 2023
4c25e36
v1.12.3
ishaileshmishra Dec 15, 2023
f05e7c4
Merge pull request #95 from contentstack/CS-42935/feat-taxonomy-and-eaf
ishaileshmishra Dec 15, 2023
1d8e7f4
Merge branch 'master' into next
ishaileshmishra Dec 15, 2023
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
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# CHANGELOG

## v1.12.3

## v1.13.0

### Date: 18-Dec-2023

- Taxonomy Query Support
- Updated Latest version of Utils SDK to 1.2.6
- Snyk Issues fixed
- Updated dependencies
- Added support for early access feature

### Date: 28-SEP-2023

Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.contentstack.sdk</groupId>
<artifactId>java</artifactId>
<version>1.12.3</version>
<version>1.13.0</version>
<packaging>jar</packaging>
<name>contentstack-java</name>
<description>Java SDK for Contentstack Content Delivery API</description>
Expand All @@ -25,18 +25,18 @@
<loggin.version>5.0.0-alpha.11</loggin.version>
<jococo-plugin.version>0.8.5</jococo-plugin.version>
<lombok-source.version>1.18.30</lombok-source.version>
<junit-jupiter.version>5.10.0</junit-jupiter.version>
<junit-jupiter.version>5.10.1</junit-jupiter.version>
<junit-jupiter-engine.version>5.8.0-M1</junit-jupiter-engine.version>
<gson.version>2.8.8</gson.version>
<json-simple-version>1.1.1</json-simple-version>
<maven-site-plugin.version>3.3</maven-site-plugin.version>
<maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<json-version>20230618</json-version>
<json-version>20231013</json-version>
<jacoco-maven-plugin-version>0.8.7</jacoco-maven-plugin-version>
<maven-release-plugin-version>2.5.3</maven-release-plugin-version>
<contentstack-utils-version>1.2.4</contentstack-utils-version>
<contentstack-utils-version>1.2.6</contentstack-utils-version>
</properties>

<parent>
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/com/contentstack/sdk/APIService.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.HeaderMap;
import retrofit2.http.Query;
import retrofit2.http.Url;

import java.util.LinkedHashMap;
import java.util.Map;

/**
* @author Shailesh Mishra
Expand All @@ -15,5 +17,11 @@
*/
public interface APIService {
@GET
Call<ResponseBody> getRequest(@Url String url, @HeaderMap LinkedHashMap<String, Object> headers);
Call<ResponseBody> getRequest(
@Url String url, @HeaderMap LinkedHashMap<String, Object> headers);

@GET("v3/taxonomies/entries")
Call<ResponseBody> getTaxonomy(
@HeaderMap Map<String, Object> headers,
@Query("query") String query);
}
4 changes: 2 additions & 2 deletions src/main/java/com/contentstack/sdk/CSHttpConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ public void send() {
}

private void getService(String requestUrl) throws IOException {
this.headers.put(X_USER_AGENT_KEY, "contentstack-java/" + SDK_VERSION);

this.headers.put(X_USER_AGENT_KEY, "contentstack-delivery-java/" + SDK_VERSION);
this.headers.put(USER_AGENT_KEY, USER_AGENT);
this.headers.put(CONTENT_TYPE, APPLICATION_JSON);

Expand Down Expand Up @@ -260,7 +261,6 @@ void handleJSONObject(JSONArray arrayEntry, JSONObject jsonObj, int idx) {
}

void setError(String errResp) {
logger.info(errResp);
responseJSON = new JSONObject(errResp); // Parse error string to JSONObject
responseJSON.put(ERROR_MESSAGE, responseJSON.optString(ERROR_MESSAGE));
responseJSON.put(ERROR_CODE, responseJSON.optString(ERROR_CODE));
Expand Down
67 changes: 39 additions & 28 deletions src/main/java/com/contentstack/sdk/Config.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.contentstack.sdk;

import lombok.Getter;
import lombok.Setter;
import okhttp3.ConnectionPool;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
Expand All @@ -26,12 +28,19 @@ public class Config {
protected JSONObject livePreviewEntry = null;
protected ContentstackRegion region = ContentstackRegion.US;
protected String managementToken;
@Setter
@Getter
protected String branch;
@Setter
protected Proxy proxy = null;
protected ConnectionPool connectionPool = new ConnectionPool();

protected List<ContentstackPlugin> plugins = null;


/**
* -- GETTER --
* The configuration for the contentstack that contains support for
public String getBranch() {
return branch;
}
Expand All @@ -55,9 +64,8 @@ public void setBranch(String branch) {
* config = new Config(); config.setProxy(proxy);
* </code>
*/
public void setProxy(Proxy proxy) {
this.proxy = proxy;
}
@Getter
protected String[] earlyAccess;

/**
* Returns the Proxy instance
Expand All @@ -73,12 +81,9 @@ public Proxy getProxy() {
* {@link okhttp3.Address} may share a {@link okhttp3.Connection}. This class implements the policy * of which
* connections to keep open for future use.
*
* @param maxIdleConnections
* the maxIdleConnections default value is 5
* @param keepAliveDuration
* the keepAliveDuration default value is 5
* @param timeUnit
* the timeUnit default value is TimeUnit. MINUTES
* @param maxIdleConnections the maxIdleConnections default value is 5
* @param keepAliveDuration the keepAliveDuration default value is 5
* @param timeUnit the timeUnit default value is TimeUnit. MINUTES
* @return ConnectionPool
*/
public ConnectionPool connectionPool(int maxIdleConnections, long keepAliveDuration, TimeUnit timeUnit) {
Expand All @@ -98,8 +103,7 @@ public ContentstackRegion getRegion() {
/**
* Sets region.
*
* @param region
* the region
* @param region the region
* @return the region
*/
public ContentstackRegion setRegion(ContentstackRegion region) {
Expand All @@ -119,20 +123,10 @@ public void setPlugins(List<ContentstackPlugin> plugins) {
this.plugins = plugins;
}

/**
* Gets host.
*
* @return the host
*/
public String getHost() {
return host;
}

/**
* Sets host.
*
* @param hostName
* the host name
* @param hostName the host name
*/
public void setHost(String hostName) {
if (hostName != null && !hostName.isEmpty()) {
Expand All @@ -152,8 +146,7 @@ public String getVersion() {
/**
* Enable live preview config.
*
* @param enableLivePreview
* to enable live preview
* @param enableLivePreview to enable live preview
* @return the config
*/
public Config enableLivePreview(boolean enableLivePreview) {
Expand All @@ -164,8 +157,7 @@ public Config enableLivePreview(boolean enableLivePreview) {
/**
* Sets live preview host.
*
* @param livePreviewHost
* the live preview host
* @param livePreviewHost the live preview host
* @return the live preview host
*/
public Config setLivePreviewHost(@NotNull String livePreviewHost) {
Expand All @@ -181,8 +173,7 @@ protected Config setLivePreviewEntry(@NotNull JSONObject livePreviewEntry) {
/**
* Sets management token.
*
* @param managementToken
* the management token
* @param managementToken the management token
* @return the management token
*/
public Config setManagementToken(@NotNull String managementToken) {
Expand All @@ -197,4 +188,24 @@ public enum ContentstackRegion {
US, EU, AZURE_NA, AZURE_EU
}


/**
* To initialize the SDK with the latest features offered in the early access phase,
* include the early access parameter as shown in the following code:
*
* @param earlyAccessFeatures The list of Early Access Features
* {@code
* Config config = new Config();
* String[] earlyAccess = {"Taxonomy", "Teams", "Terms", "LivePreview"};
* config.earlyAccess(earlyAccess);
* Stack stack = Contentstack.stack(API_KEY, DELIVERY_TOKEN, ENV, config);
* <p>
* }
* @return Config
*/
public Config earlyAccess(@NotNull String[] earlyAccessFeatures) {
this.earlyAccess = earlyAccessFeatures;
return this;
}

}
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/sdk/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class Constants {

private static final Logger logger = Logger.getLogger(Constants.class.getSimpleName());
protected static final String SDK_VERSION = "1.12.3";
protected static final String SDK_VERSION = "1.13.0";
protected static final String ENVIRONMENT = "environment";
protected static final String CONTENT_TYPE_UID = "content_type_uid";
protected static final String ENTRY_UID = "entry_uid";
Expand Down
27 changes: 14 additions & 13 deletions src/main/java/com/contentstack/sdk/Contentstack.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,23 @@ protected Contentstack() throws IllegalAccessException {
* key of your stack. <br>
* Find Your Stack Credentials from Contentstack .
*
* @param stackApiKey
* The API Key is a unique key assigned to each stack.
* @param deliveryToken
* The Delivery Token is a read-only credential that you
* @param stackApiKey The API Key is a unique key assigned to each stack.
* @param deliveryToken The Delivery Token is a read-only credential that you
* can create for different environments of your
* stack
* @param environment
* the environment for the stack
* @param environment the environment for the stack
* @return the stack
* @throws IllegalAccessException
* the illegal access exception
* @throws IllegalAccessException the illegal access exception
* <p>
* <b>Example</b>
*
* <pre>
* {
* &#64;Code
* Stack stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
* }
* {
* &#64;Code
* Stack stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
* }
*
* </pre>
* </pre>
*/
public static Stack stack(String stackApiKey, String deliveryToken, String environment)
throws IllegalAccessException {
Expand All @@ -66,6 +62,7 @@ public static Stack stack(String stackApiKey, String deliveryToken, String envir
* create content structures, content entries, users, etc. related to the
* project.
*

* @param stackApiKey
* The API Key is a unique key assigned to each stack.
* @param deliveryToken
Expand Down Expand Up @@ -115,6 +112,10 @@ private static Stack initializeStack(String stackApiKey, String deliveryToken, S
if (config.getBranch() != null && !config.getBranch().isEmpty()) {
stack.setHeader("branch", config.getBranch());
}
if (config.getEarlyAccess() != null && config.getEarlyAccess().length > 0) {
String eaValues = String.join(",", config.earlyAccess).replace("\"", "");
stack.setHeader("x-header-ea", eaValues);
}
stack.setConfig(config);
return stack;
}
Expand Down
Loading
Loading