diff --git a/.github/workflows/sast-scan.yml b/.github/workflows/sast-scan.yml
deleted file mode 100644
index f931630..0000000
--- a/.github/workflows/sast-scan.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-name: SAST Scan
-on:
- pull_request:
- types: [opened, synchronize, reopened]
-jobs:
- security:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Horusec Scan
- run: docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/src horuszup/horusec-cli:latest horusec start -p /src -P $(pwd)
\ No newline at end of file
diff --git a/.github/workflows/sca-scan.yml b/.github/workflows/sca-scan.yml
index b11e368..e7acba9 100644
--- a/.github/workflows/sca-scan.yml
+++ b/.github/workflows/sca-scan.yml
@@ -11,12 +11,12 @@ jobs:
- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v1
with:
- dotnet-version: '3.1.x'
+ dotnet-version: "7.0.x"
- name: Run Dotnet Restore
run: |
dotnet restore
- name: Run Snyk to check for vulnerabilities
- uses: snyk/actions/dotnet@master
+ uses: snyk/actions/dotnet@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
diff --git a/.github/workflows/secrets-scan.yml b/.github/workflows/secrets-scan.yml
deleted file mode 100644
index 1e8f176..0000000
--- a/.github/workflows/secrets-scan.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-name: Secrets Scan
-on:
- pull_request:
- types: [opened, synchronize, reopened]
-jobs:
- security:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Gittyleaks
- uses: gupy-io/gittyleaks-action@v0.1
\ No newline at end of file
diff --git a/Contentstack.AspNetCore/Contentstack.AspNetCore.csproj b/Contentstack.AspNetCore/Contentstack.AspNetCore.csproj
index e09e0eb..8d19bfb 100644
--- a/Contentstack.AspNetCore/Contentstack.AspNetCore.csproj
+++ b/Contentstack.AspNetCore/Contentstack.AspNetCore.csproj
@@ -6,12 +6,12 @@
contentstack.aspnetcore
Contentstack
Contentstack
- 2.10.0
+ 2.11.0
Main release
Copyright (c) 2012-2023 Contentstack (http://app.contentstack.com). All Rights Reserved
https://github.com/contentstack/contentstack-dotnet
- v2.10.0
- 2.10.0
+ v2.11.0
+ 2.11.0
Release;Debug
@@ -29,6 +29,6 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/Contentstack.Core.Tests/AssetTest.cs b/Contentstack.Core.Tests/AssetTest.cs
index 32f6a12..88bc5d4 100644
--- a/Contentstack.Core.Tests/AssetTest.cs
+++ b/Contentstack.Core.Tests/AssetTest.cs
@@ -2,13 +2,9 @@
using Xunit;
using Contentstack.Core.Models;
using System.Threading.Tasks;
-using Contentstack.Core.Configuration;
using System.Collections.Generic;
using System.Linq;
-using System.Text.RegularExpressions;
-using System.Collections;
using Newtonsoft.Json.Linq;
-using Contentstack.Utils;
namespace Contentstack.Core.Tests
{
public class AssetTest
@@ -128,7 +124,8 @@ public async Task FetchAssetsIncludeRelativeURL()
[Fact]
public async Task FetchAssetCountAsync()
{
- AssetLibrary assetLibrary = client.AssetLibrary().SetLocale("en-us");
+ AssetLibrary assetLibrary = client.AssetLibrary().
+ IncludeMetadata().SetLocale("en-us");
JObject jObject = await assetLibrary.Count();
if (jObject == null)
{
diff --git a/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj b/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj
index 3606c0a..e7fbfab 100644
--- a/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj
+++ b/Contentstack.Core.Tests/Contentstack.Core.Tests.csproj
@@ -1,21 +1,21 @@
- netcoreapp3.1
+ net7.0
false
- 2.10.0
+ 2.11.0
-
-
- runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
diff --git a/Contentstack.Core.Tests/EntryTest.cs b/Contentstack.Core.Tests/EntryTest.cs
index 819d3d6..17e5491 100644
--- a/Contentstack.Core.Tests/EntryTest.cs
+++ b/Contentstack.Core.Tests/EntryTest.cs
@@ -48,7 +48,7 @@ public async Task FetchByUid() {
ContentType contenttype = client.ContentType(source);
string uid = await GetUID("source1");
Entry sourceEntry = contenttype.Entry(uid);
-
+ sourceEntry.IncludeMetadata();
await sourceEntry.Fetch().ContinueWith((t) =>
{
Entry result = t.Result;
diff --git a/Contentstack.Core.Tests/QueryTest.cs b/Contentstack.Core.Tests/QueryTest.cs
index a7906f6..c8ea1ab 100644
--- a/Contentstack.Core.Tests/QueryTest.cs
+++ b/Contentstack.Core.Tests/QueryTest.cs
@@ -61,6 +61,7 @@ public async Task FetchEntriesPublishFallback()
ContentstackCollection entries = await client.ContentType(source).Query()
.SetLocale("ja-jp")
.IncludeFallback()
+ .IncludeMetadata()
.Find();
;
Assert.True(entries.Items.Count() > 0);
diff --git a/Contentstack.Core.Tests/StackConfig.cs b/Contentstack.Core.Tests/StackConfig.cs
index 8a0e67a..4cb8eb0 100644
--- a/Contentstack.Core.Tests/StackConfig.cs
+++ b/Contentstack.Core.Tests/StackConfig.cs
@@ -37,6 +37,7 @@ public static ContentstackClient GetStack()
DeliveryToken = delivery_token,
Environment = environment,
Host = host,
+
};
ContentstackClient contentstackClient = new ContentstackClient(new OptionsWrapper(contentstackOptions));
diff --git a/Contentstack.Core/Configuration/Config.cs b/Contentstack.Core/Configuration/Config.cs
index 88041d4..50af06b 100644
--- a/Contentstack.Core/Configuration/Config.cs
+++ b/Contentstack.Core/Configuration/Config.cs
@@ -98,14 +98,14 @@ internal string regionCode()
{
if (Region == ContentstackRegion.US) return "";
ContentstackRegionCode[] regionCodes = Enum.GetValues(typeof(ContentstackRegionCode)).Cast().ToArray();
- return string.Format("{0}-", regionCodes[(int)Region].ToString());
+ return string.Format("{0}-", regionCodes[(int)Region].ToString().Replace("_", "-"));
}
internal string HostURL
{
get
{
- if (Region == ContentstackRegion.EU)
+ if (Region == ContentstackRegion.EU || Region == ContentstackRegion.AZURE_EU || Region == ContentstackRegion.AZURE_NA)
return "cdn.contentstack.com";
return "cdn.contentstack.io";
}
diff --git a/Contentstack.Core/Contentstack.Core.csproj b/Contentstack.Core/Contentstack.Core.csproj
index b4ea183..2dc5722 100644
--- a/Contentstack.Core/Contentstack.Core.csproj
+++ b/Contentstack.Core/Contentstack.Core.csproj
@@ -5,15 +5,15 @@
contentstack.csharp
Contentstack
.NET SDK for the Contentstack Content Delivery API.
- 2.10.0
+ 2.11.0
Contentstack
Reference in entry Live preview support added
Copyright © 2012-2023 Contentstack. All Rights Reserved
true
- v2.10.0
+ v2.11.0
https://github.com/contentstack/contentstack-dotnet
LICENSE.txt
- 2.10.0
+ 2.11.0
@@ -26,9 +26,9 @@
-
+
-
+
diff --git a/Contentstack.Core/Internals/ContentstackRegion.cs b/Contentstack.Core/Internals/ContentstackRegion.cs
index 28b4edd..fa0bec1 100644
--- a/Contentstack.Core/Internals/ContentstackRegion.cs
+++ b/Contentstack.Core/Internals/ContentstackRegion.cs
@@ -13,7 +13,16 @@ public enum ContentstackRegion
///
/// To specify EU region.
///
- EU
+ EU,
+ ///
+ /// To specify EU region.
+ ///
+ AZURE_EU,
+
+ ///
+ /// To specify EU region.
+ ///
+ AZURE_NA
}
@@ -21,6 +30,11 @@ internal enum ContentstackRegionCode
{
us,
- eu
+ eu,
+
+ azure_eu,
+
+ azure_na
+
}
}
diff --git a/Contentstack.Core/Internals/HttpRequestHandler.cs b/Contentstack.Core/Internals/HttpRequestHandler.cs
index 3a4f6da..6ecd2c5 100644
--- a/Contentstack.Core/Internals/HttpRequestHandler.cs
+++ b/Contentstack.Core/Internals/HttpRequestHandler.cs
@@ -48,7 +48,7 @@ public async Task ProcessRequest(string Url, Dictionary
var request = (HttpWebRequest)WebRequest.Create(uri);
request.Method = "GET";
request.ContentType = "application/json";
- request.Headers["x-user-agent"]="contentstack-dotnet/2.10.0";
+ request.Headers["x-user-agent"]="contentstack-dotnet/2.11.0";
if (Branch != null)
{
request.Headers["branch"] = Branch;
diff --git a/Contentstack.Core/Models/Asset.cs b/Contentstack.Core/Models/Asset.cs
index 9fa04ce..ad91aa8 100644
--- a/Contentstack.Core/Models/Asset.cs
+++ b/Contentstack.Core/Models/Asset.cs
@@ -178,6 +178,36 @@ public Asset includeFallback()
return this;
}
+
+
+ ///
+ /// This call includes metadata in the response.
+ ///
+ /// Current instance of Asset, this will be useful for a chaining calls.
+ ///
+ ///
+ /// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
+ /// Asset asset = stack.Asset("asset_uid");
+ /// asset.IncludeMetadata();
+ /// asset.Fetch<Product>().ContinueWith((assetResult) => {
+ /// //Your callback code.
+ /// });
+ ///
+ ///
+ public Asset IncludeMetadata()
+ {
+ try
+ {
+ this.UrlQueries.Add("include_metadata", "true");
+ }
+ catch (Exception e)
+ {
+ throw new Exception(StackConstants.ErrorMessage_QueryFilterException, e);
+ }
+ return this;
+ }
+
+
///
/// Include branch for publish content.
///
diff --git a/Contentstack.Core/Models/AssetLibrary.cs b/Contentstack.Core/Models/AssetLibrary.cs
index 387ff95..9c1a072 100644
--- a/Contentstack.Core/Models/AssetLibrary.cs
+++ b/Contentstack.Core/Models/AssetLibrary.cs
@@ -185,6 +185,36 @@ public void IncludeCount()
UrlQueries.Add("include_count", "true");
}
+
+
+
+ ///
+ /// This call includes metadata in the response.
+ ///
+ /// Current instance of AssetLibrary, this will be useful for a chaining calls.
+ ///
+ ///
+ /// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
+ /// AssetLibrary assetLibrary = stack.AssetLibrary();
+ /// assetLibrary.IncludeMetadata();
+ /// ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
+ ///
+ ///
+ public AssetLibrary IncludeMetadata()
+ {
+ try
+ {
+ UrlQueries.Add("include_metadata", "true");
+ }
+ catch (Exception e)
+ {
+ throw new Exception(StackConstants.ErrorMessage_QueryFilterException, e);
+ }
+ return this;
+ }
+
+
+
///
/// This method includes the relative url of assets.
///
diff --git a/Contentstack.Core/Models/Entry.cs b/Contentstack.Core/Models/Entry.cs
index a5338dc..123845d 100644
--- a/Contentstack.Core/Models/Entry.cs
+++ b/Contentstack.Core/Models/Entry.cs
@@ -1054,6 +1054,37 @@ public Entry IncludeFallback()
return this;
}
+
+ ///
+ /// Include metadata includes metadata.
+ ///
+ /// Current instance of Entry, this will be useful for a chaining calls.
+ ///
+ ///
+ /// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
+ /// Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
+ /// entry.IncludeMetadata();
+ /// entry.Fetch<Product>().ContinueWith((entryResult) => {
+ /// //Your Metadata code.
+ /// });
+ ///
+ ///
+ public Entry IncludeMetadata()
+ {
+ try
+ {
+ UrlQueries.Add("include_metadata", "true");
+ }
+ catch (Exception e)
+ {
+ throw new Exception(StackConstants.ErrorMessage_QueryFilterException, e);
+ }
+ return this;
+ }
+
+
+
+
///
/// Include branch for publish content.
///
diff --git a/Contentstack.Core/Models/Query.cs b/Contentstack.Core/Models/Query.cs
index 4038d96..5166d14 100644
--- a/Contentstack.Core/Models/Query.cs
+++ b/Contentstack.Core/Models/Query.cs
@@ -1154,6 +1154,35 @@ public Query IncludeCount()
return this;
}
+
+
+ ///
+ /// This call includes metadata in the response.
+ ///
+ /// Current instance of Query, this will be useful for a chaining calls.
+ ///
+ ///
+ /// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
+ /// Query csQuery = stack.ContentType("contentType_id").Query();
+ /// csQuery.IncludeMetadata();
+ /// csQuery.Find<Product>().ContinueWith((queryResult) => {
+ /// //Your metadata code.
+ /// });
+ ///
+ ///
+ public Query IncludeMetadata()
+ {
+ try
+ {
+ UrlQueries.Add("include_metadata", "true");
+ }
+ catch (Exception e)
+ {
+ throw new Exception(StackConstants.ErrorMessage_QueryFilterException, e);
+ }
+ return this;
+ }
+
///
/// This method also includes owner information for all the entries returned in the response.
///
diff --git a/Contentstack.Net.sln b/Contentstack.Net.sln
index 61b1d93..625ca2b 100644
--- a/Contentstack.Net.sln
+++ b/Contentstack.Net.sln
@@ -132,6 +132,6 @@ Global
$0.XmlFormattingPolicy = $9
$9.scope = application/xml
$0.StandardHeader = $10
- version = 2.10.0
+ version = 2.11.0
EndGlobalSection
EndGlobal
diff --git a/global.json b/global.json
index 79893f3..d8f262e 100644
--- a/global.json
+++ b/global.json
@@ -1,5 +1,5 @@
{
"sdk": {
- "version": "3.1.404"
+ "version": "7.0.400"
}
}