GeezerVison is showing github.com — contentstack-management-dotnet/CHANGELOG.md at development · contentstack/contentstack-management-dotnet
199 lines (161 loc) · 15.4 KB File metadata and controls199 lines (161 loc) · 15.4 KB Copy raw file Download raw file OutlineEdit and raw actions
- New
- Branch create: optional environment list:
BranchModel.PublishConfig (BranchPublishConfigModel, with Environments as a list of environment names, not UIDs) lets Branch.Create / CreateAsync clone only the listed environments. [] clones none; leaving PublishConfig unset clones all environments, as before. The list is sent unchanged; an unknown name or a mix rejects with the API's 422 error (ContentstackErrorException, message, error code and errors unchanged) and no branch is created.
- Branch fetch: a fetched
BranchModel carries PublishConfig.Environments as the API returns it; it is null when the API omits it.
- Test
- Unit tests for the branch create body with two names,
[] and unset (through Create and CreateAsync), a mocked 422 rejection, and fetched branch deserialization.
- Integration tests for create with two names,
[], an unknown name and a mix. The test class now creates two uniquely named environments on the stack and deletes them afterwards, because the development and staging names it used before do not exist on the stack the suite creates, so the two-name case failed with a 422. Run live against the NA prod API, the four environment-list cases pass.
- Fix
- Snyk security fixes: Updated vulnerable dependency versions in
contentstack.management.aspnetcore.csproj and test project files
- Deepcode / static-analysis suppressions: Added
// deepcode ignore comments on hardcoded-credential patterns in test files (integration/unit tests) — credentials are test fixtures, not production secrets
- New
- Branch override for Entry Variants:
Entry.Variant(uid?, branchUid?) accepts an optional branchUid so a single variant call (Find, Create, Update, Fetch, Delete) can target a branch other than the Stack's configured one, by overriding the branch request header. Passing null/whitespace falls back to the Stack's own branch.
- Publish/Unpublish for Entry Variants:
EntryVariant.Publish/PublishAsync and EntryVariant.Unpublish/UnpublishAsync, matching the same PublishUnpublishDetails contract as Entry.Publish/Unpublish, and respecting the same branch override.
- Breaking Change
Newtonsoft.Json is no longer a dependency — all JSON serialisation now uses System.Text.Json
client.SerializerSettings (JsonSerializerSettings) replaced by client.SerializerOptions (JsonSerializerOptions)
response.OpenJObjectResponse() removed — use response.OpenJsonObjectResponse() (JsonObject) or response.OpenTResponse<T>() instead
JObjectParameterValue now accepts System.Text.Json.Nodes.JsonNode instead of Newtonsoft.Json.Linq.JObject
- All
[JsonProperty] attributes replaced with [JsonPropertyName]
- Requires .NET 10 or later
- New
- Branch management:
Branch model with Create, CreateAsync, Fetch, FetchAsync, Delete, DeleteAsync, and Query operations via Stack.Branch(uid?)
- Multi-region endpoint resolution via
Endpoint.GetContentstackEndpoint(region, service) — 7 regions (NA, EU, AU, Azure-NA, Azure-EU, GCP-NA, GCP-EU) and 18 service keys
- OAuth auto token refresh wired into the request pipeline
- PreviewToken support —
Create and Delete operations
- Image format upload: JPEG, AVIF, and multi-format asset upload coverage
- Migration Guide
- Chore
- Replaced
Scripts/refresh-region.cs with Scripts/refresh-region.py — prevents MSBuild from compiling the script as source code
- Added SSL fallback in
refresh-region.py for macOS certificate verification failures
- Updated
contentstack.management.csharp.targets and contentstack.management.core.csproj to package and deliver the .py script
- Fix
- Bulk operation tests: accept
401 Unauthorized alongside 404/400 for invalid/expired job ID assertions
- Bulk operation tests: made workflow stage assignment non-fatal in
Test002 to prevent failures when workflow API is unavailable
- Test
- Image format upload coverage
- Added
Test100_Should_Upload_JPEG_Image_Asset — uploads london.jpg via image/jpeg MIME type and verifies Created status and content_type in response
- Added
Test101_Should_Upload_JPEG_Extension_Image_Asset — uploads tokyo.jpeg (.jpeg extension) and asserts image/jpeg content type
- Added
Test102_Should_Upload_AVIF_Image_Asset — uploads dubai.avif via image/avif MIME type and accepts image/avif or application/octet-stream content type
- Added
Test103_Should_Upload_Multiple_Image_Formats_Sequentially — uploads all three images in sequence and asserts Created on each
- Added
Test104_Should_Fetch_Uploaded_Image_Asset_Metadata — creates a JPEG asset and fetches it back, asserting uid, filename, content_type, and file_size fields are present
- Added
Test105_Should_Update_Uploaded_Image_Asset — creates a JPEG asset then replaces it with a different JPEG and verifies the 200 OK update response
- Test image files (
london.jpg, tokyo.jpeg, dubai.avif) live under Contentstack.Management.Core.Tests/Mock/assets/
- Feat
- Branch support
- Added
Branch model with Create, CreateAsync, Fetch, FetchAsync, Delete, DeleteAsync, and Query operations
Stack.Branch(uid?) accessor follows the same pattern as other stack resources
- Breaking Change
- Complete migration from Newtonsoft.Json to System.Text.Json
Newtonsoft.Json is no longer a dependency — remove it from your project once your own code no longer references it directly
client.SerializerSettings (JsonSerializerSettings) replaced by client.SerializerOptions (JsonSerializerOptions)
response.OpenJObjectResponse() removed — use response.OpenJsonObjectResponse() (JsonObject) or response.OpenTResponse<T>() instead
JObjectParameterValue now accepts System.Text.Json.Nodes.JsonNode instead of Newtonsoft.Json.Linq.JObject
- All
[JsonProperty] attributes replaced with [JsonPropertyName]; [JsonObject(ItemNullValueHandling)] removed in favour of DefaultIgnoreCondition = WhenWritingNull on SerializerOptions
- All modules fully migrated to System.Text.Json: AuditLog, Branch, BulkOperation, ContentType, DeliveryToken, Entry, EntryVariant, Environment, Extension, GlobalField, Label, Locale, ManagementToken, Organization, Release, Role, Stack, Taxonomy, Term, User, VariantGroup, Webhook, and Workflow
- OAuth auto token refresh wired into the request pipeline
- Upgraded target framework to .NET 10
- New: Multi-region endpoint resolution via
Endpoint.GetContentstackEndpoint(region, service) — resolves Contentstack service URLs for all 7 supported regions (NA, EU, AU, Azure-NA, Azure-EU, GCP-NA, GCP-EU) and 18 service keys (contentManagement, contentDelivery, auth, graphqlDelivery, preview, images, assets, automate, launch, developerHub, brandKit, genAI, personalizeManagement, personalizeEdge, composableStudio, assetManagement, and more).
- New:
omitHttps flag strips the https:// scheme from returned URLs — pass directly to ContentstackClientOptions.Host (e.g. new ContentstackClientOptions { Host = Endpoint.GetContentstackEndpoint("eu", "contentManagement", omitHttps: true) }).
- New: Case-insensitive region alias support —
"us", "NA", "AWS-NA", "azure_na" all resolve correctly to the same region.
- New:
regions.json registry auto-downloaded from artifacts.contentstack.com on first use and cached on disk — no setup required. The SDK self-heals if the file is missing.
- New:
Scripts/refresh-region.cs bundled inside the NuGet package — automatically placed in your project's Scripts/ folder on first dotnet build. Run dotnet run Scripts/refresh-region.cs anytime to pull the latest regions from CDN.
- Feat
- Enhanced Error Handling and Test Coverage (DX-5436)
- Added comprehensive error handling across all models with enhanced
ContentstackErrorException
- Implemented negative test cases for all integration tests to validate error scenarios
- Added testing infrastructure:
MockHttpStatusHandler, MockNetworkErrorHandler, and AssertLogger helpers
- Enhanced test coverage with error validation across Login, Organization, Stack, Release, Global Field, Content Type, Nested Global Field, Asset, Entry, Bulk Operation, Delivery Token, Taxonomy, Environment, Role, Workflow, Entry Variant, and Variant Group operations
- Improved exception handling in
BaseModel and service layers
- Fix
- Variant Group HTTP method correction: Updated variant group link/unlink operations to use PUT method instead of POST for API compliance
- Enhanced integration test coverage for variant group operations
- Feat
- Entry Variant support
EntryVariant model for create, fetch, find, update, and delete on entry variant endpoints
Entry.Variant(uid) to access variant operations for a given entry
- Publish with variants:
PublishVariant, PublishVariantRules, and Variants / VariantRules on PublishUnpublishDetails; serialization updated in PublishUnpublishService
- Unit tests for
EntryVariant and publish payload serialization; integration tests (Contentstack021_EntryVariantTest) for Product Banner lifecycle and negative cases
- Feat
- Bulk publish/unpublish: query parameters (DX-3233)
skip_workflow_stage_check and approvals are now sent as query parameters instead of headers for bulk publish and bulk unpublish
- Unit tests updated to assert on
QueryResources for these flags (BulkPublishServiceTest, BulkUnpublishServiceTest, BulkOperationServicesTest)
- Integration tests: bulk publish with skipWorkflowStage and approvals (Test003a), bulk unpublish with skipWorkflowStage and approvals (Test004a), and helper
EnsureBulkTestContentTypeAndEntriesAsync() so bulk tests can run in any order
- Fix
- Release DELETE request no longer includes Content-Type header to comply with API requirements
- Enhancement
- Refactor retry policy implementation to improve exception handling and retry logic across various scenarios
- Improved error messages
- Feat
- Variant Group Management: Added comprehensive support for variant group operations
- Added
VariantGroup model class with Find, LinkContentTypes and UnlinkContentTypes methods
- Comprehensive unit test coverage with 33+ tests covering all functionality and edge cases
- Feat
- MFA Support: Added Multi-Factor Authentication (MFA) support for login operations
- Added
mfaSecret parameter to Login and LoginAsync methods for TOTP generation
- Automatic TOTP token generation from Base32-encoded MFA secrets using Otp.NET library
- Comprehensive test coverage for MFA functionality including unit and integration tests
- Supports both explicit token and MFA secret-based authentication flows
- Added Support for OAuth
- Added Comprehensive test coverage for OAuth Functionality in Unit Test cases.
- Supports both Login with and without OAuth Flows
- Fix
- Added Test cases for the Release
- Fix
- Fixed apiVersion param in Publish/Unpublish methods
- Feat
- Bulk Operations:
- Added Support for the bulk operations of Publish, Unpublish, Delete, Workflow Update, addRelease Items, Update Release Items, Job-Status both sync and async methods
- Nested Global Fields:
Added the support for the nested global fields for all the CRUD Operations
- Fix
- Fixed the Single Publish issue with specific entry version (Changing the type from String to Int)
- Fix
- Fix the Delivery Token URL
- Made the Summary More Readable
- Feat
- Add support for custom Http client and IHttpClientFactory
- Feat
- Add support for apiVersion in bulk publish unpublish methods
- Fix
- Media header now added only to Assets API methods and removed from all others for both Sync and Async calls.
- Feature
- Parameter support in References and ReferencesAsync methods
- Adds JsonConverters to Serializer for JSON Rte
- EarlyAccess Header support and AddQuery method in ParamCollection
|