Skip to content

Commit 29e7b2d

Browse files
authored
Merge pull request #7 from contentstack/fix/CS-36240-token-issue
Fix issue for management token
2 parents 1cec2b0 + 8095ae2 commit 29e7b2d

File tree

12 files changed

+83
-14
lines changed

12 files changed

+83
-14
lines changed

.github/workflows/unit-test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Unit Test & Reports
2+
on:
3+
pull_request:
4+
push:
5+
6+
jobs:
7+
unit-test:
8+
runs-on: windows-latest
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v1
12+
- name: Setup .NET Core @ Latest
13+
uses: actions/setup-dotnet@v1
14+
- name: Build solution and run unit test
15+
run: sh ./Scripts/run-unit-test-case.sh
16+
- name: Test Report
17+
uses: dorny/test-reporter@v1
18+
if: success() || failure()
19+
with:
20+
name: DotNet unit Tests
21+
path: ./Contentstack.Management.Core.Unit.Tests/TestResults/Report-Contentstack-DotNet-Test-Case.trx
22+
reporter: dotnet-trx
23+
fail-on-error: true

Contentstack.Management.ASPNETCore/contentstack.management.aspnetcore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<Description>.NET SDK for the Contentstack Content Management API.</Description>
1616
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
1717
<PackageTags>v0.1.2</PackageTags>
18-
<ReleaseVersion>0.1.2</ReleaseVersion>
18+
<ReleaseVersion>0.1.3</ReleaseVersion>
1919
<RootNamespace>Contentstack.Management.ASPNETCore</RootNamespace>
2020
</PropertyGroup>
2121

Contentstack.Management.Core.Tests/Contentstack.Management.Core.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
7-
<ReleaseVersion>0.1.2</ReleaseVersion>
7+
<ReleaseVersion>0.1.3</ReleaseVersion>
88
</PropertyGroup>
99

1010
<ItemGroup>

Contentstack.Management.Core.Unit.Tests/Contentstack.Management.Core.Unit.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
7-
<ReleaseVersion>0.1.2</ReleaseVersion>
7+
<ReleaseVersion>0.1.3</ReleaseVersion>
88
</PropertyGroup>
99

1010
<ItemGroup>

Contentstack.Management.Core.Unit.Tests/Http/ContentstackHttpResponseTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public void Initialize_Response_On_Success()
1717

1818
Assert.IsNotNull(contentstackHttpResponse.ResponseBody);
1919
Assert.AreEqual(HttpStatusCode.OK, contentstackHttpResponse.StatusCode);
20-
Assert.AreEqual(1200, contentstackHttpResponse.ContentLength);
2120
Assert.AreEqual("application/json", contentstackHttpResponse.ContentType);
2221
Assert.AreEqual(true, contentstackHttpResponse.IsSuccessStatusCode);
2322
}

Contentstack.Management.Core.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Global
5151
{C90C9782-D041-43A1-B13E-21B72B9A6BE2} = {0977D0FB-EACA-4FBE-A780-2DC2B6523E53}
5252
EndGlobalSection
5353
GlobalSection(MonoDevelopProperties) = preSolution
54-
version = 0.1.2
54+
version = 0.1.3
5555
Policies = $0
5656
$0.DotNetNamingPolicy = $1
5757
$1.DirectoryNamespaceAssociation = PrefixedHierarchical

Contentstack.Management.Core/Models/Fields/FieldMetadata.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,12 @@ public class FieldMetadata
8282
public bool RefMultiple { get; set; }
8383

8484
}
85+
public class FileFieldMetadata: FieldMetadata
86+
{
87+
/// <summary>
88+
/// Allows you to set single or multiple reference to Reference field.
89+
/// </summary>
90+
[JsonProperty(propertyName: "image")]
91+
public bool AllowOnlyImage { get; set; }
92+
}
8593
}

Contentstack.Management.Core/Models/Fields/FileField.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,27 @@ public class FileField : Field
88
{
99
[JsonProperty(propertyName: "extensions")]
1010
public List<string> Extensions { get; set; }
11+
[JsonProperty(propertyName: "max")]
12+
public int Maxsize { get; set; }
13+
[JsonProperty(propertyName: "min")]
14+
public int MinSize { get; set; }
15+
16+
}
17+
public class ImageField : FileField
18+
{
19+
[JsonProperty(propertyName: "dimension")]
20+
public Dimension Dimensions { get; set; }
21+
/// <summary>
22+
/// Allows you to enter additional data about a field. Also, you can add additional values under ‘field_metadata’.
23+
/// </summary>
24+
[JsonProperty(propertyName: "field_metadata")]
25+
public new FileFieldMetadata FieldMetadata { get; set; }
26+
}
27+
public class Dimension
28+
{
29+
[JsonProperty(propertyName: "height")]
30+
public Dictionary<string, int> Height { get; set; }
31+
[JsonProperty(propertyName: "width")]
32+
public Dictionary<string, int> Width { get; set; }
1133
}
1234
}

Contentstack.Management.Core/Queryable/Query.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public Query IncludeCount()
8282
/// <returns>The <see cref="ContentstackResponse"/></returns>
8383
public ContentstackResponse Find(ParameterCollection collection = null)
8484
{
85-
_stack.client.ThrowIfNotLoggedIn();
85+
_stack.ThrowIfNotLoggedIn();
8686
this.ThrowIfAPIKeyEmpty();
8787
if (collection != null)
8888
{
@@ -102,7 +102,7 @@ public ContentstackResponse Find(ParameterCollection collection = null)
102102
/// <returns>The Task</returns>
103103
public Task<ContentstackResponse> FindAsync(ParameterCollection collection = null)
104104
{
105-
_stack.client.ThrowIfNotLoggedIn();
105+
_stack.ThrowIfNotLoggedIn();
106106
this.ThrowIfAPIKeyEmpty();
107107
if (collection != null)
108108
{

Contentstack.Management.Core/contentstack.management.core.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;net471;net472;</TargetFrameworks>
55
<PackageId>contentstack.management.csharp</PackageId>
6-
<PackageVersion>0.1.2</PackageVersion>
6+
<PackageVersion>0.1.3</PackageVersion>
77
<Authors>Contentstack</Authors>
88
<Copyright>Copyright © 2012-2023 Contentstack. All Rights Reserved</Copyright>
99
<Owners>Contentstack </Owners>
1010
<PackageProjectUrl>https://github.com/contentstack/contentstack-management-dotnet</PackageProjectUrl>
11-
<PackageReleaseNotes>Initial Release</PackageReleaseNotes>
11+
<PackageReleaseNotes>ContentType query issue resolved</PackageReleaseNotes>
1212
<Summary>.NET SDK for the Contentstack Content Delivery API.</Summary>
1313
<PackageTags>Contentstack management API </PackageTags>
1414
<Title>Contentstack Management</Title>
1515
<Description>.NET SDK for the Contentstack Content Management API.</Description>
1616
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
17-
<PackageTags>v0.1.2</PackageTags>
18-
<ReleaseVersion>0.1.2</ReleaseVersion>
17+
<PackageTags>v0.1.3</PackageTags>
18+
<ReleaseVersion>0.1.3</ReleaseVersion>
1919
</PropertyGroup>
2020

2121
<ItemGroup>

0 commit comments

Comments
 (0)