Skip to content

Commit

Permalink
TASK: Updating SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Auto Mation committed Aug 9, 2023
1 parent 64cfe31 commit 189c406
Show file tree
Hide file tree
Showing 370 changed files with 2,001 additions and 1,201 deletions.
144 changes: 116 additions & 28 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
**Api changes**

<details>
<summary>Added Resource(s)</summary>
<summary>Changed Property(s)</summary>

- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts`
- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/key={key}`
- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/{ID}`
- :warning: changed property `money` of type `CartDiscountValueFixed` from type `CentPrecisionMoney[]` to `TypedMoney[]`
- :warning: changed property `money` of type `CartDiscountValueFixedDraft` from type `Money[]` to `TypedMoneyDraft[]`
- :warning: changed property `country` of type `StagedOrder` from type `string` to `CountryCode`
- :warning: changed property `locale` of type `StagedOrder` from type `string` to `Locale`
- :warning: changed property `country` of type `StagedOrderSetCountryAction` from type `string` to `CountryCode`
- :warning: changed property `locale` of type `StagedOrderSetLocaleAction` from type `string` to `Locale`
- :warning: changed property `country` of type `Order` from type `string` to `CountryCode`
- :warning: changed property `locale` of type `Order` from type `string` to `Locale`
- :warning: changed property `country` of type `OrderImportDraft` from type `string` to `CountryCode`
- :warning: changed property `locale` of type `OrderSetLocaleAction` from type `string` to `Locale`
</details>


Expand All @@ -14,6 +21,7 @@

- added property `stores` to type `CartDiscount`
- added property `stores` to type `CartDiscountDraft`
- added property `taxedPricePortions` to type `CustomLineItem`
- added property `customLineItemKey` to type `CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction`
- added property `customLineItemKey` to type `CartChangeCustomLineItemMoneyAction`
- added property `customLineItemKey` to type `CartChangeCustomLineItemPriceModeAction`
Expand All @@ -23,7 +31,9 @@
- added property `customLineItemKey` to type `CartSetCustomLineItemCustomTypeAction`
- added property `customLineItemKey` to type `CartSetCustomLineItemShippingDetailsAction`
- added property `customLineItemKey` to type `CartSetCustomLineItemTaxAmountAction`
- added property `shippingKey` to type `CartSetCustomLineItemTaxAmountAction`
- added property `customLineItemKey` to type `CartSetCustomLineItemTaxRateAction`
- added property `shippingKey` to type `CartSetCustomLineItemTaxRateAction`
- added property `associate` to type `ClientLogging`
- added property `associate` to type `CreatedBy`
- added property `associate` to type `LastModifiedBy`
Expand Down Expand Up @@ -56,19 +66,33 @@
- added property `customLineItemKey` to type `StagedOrderSetCustomLineItemCustomTypeAction`
- added property `customLineItemKey` to type `StagedOrderSetCustomLineItemShippingDetailsAction`
- added property `customLineItemKey` to type `StagedOrderSetCustomLineItemTaxAmountAction`
- added property `shippingKey` to type `StagedOrderSetCustomLineItemTaxAmountAction`
- added property `customLineItemKey` to type `StagedOrderSetCustomLineItemTaxRateAction`
- added property `shippingKey` to type `StagedOrderSetCustomLineItemTaxRateAction`
- added property `returnItemKey` to type `StagedOrderSetReturnItemCustomFieldAction`
- added property `returnItemKey` to type `StagedOrderSetReturnItemCustomTypeAction`
- added property `returnItemKey` to type `StagedOrderSetReturnPaymentStateAction`
- added property `returnItemKey` to type `StagedOrderSetReturnShipmentStateAction`
- added property `customLineItemKey` to type `StagedOrderTransitionCustomLineItemStateAction`
- added property `lineItemKey` to type `StagedOrderTransitionLineItemStateAction`
- added property `key` to type `CustomLineItemImportDraft`
- added property `key` to type `CustomLineItemReturnItem`
- added property `key` to type `LineItemImportDraft`
- added property `key` to type `LineItemReturnItem`
- added property `directDiscounts` to type `Order`
- added property `purchaseOrderNumber` to type `OrderImportDraft`
- added property `taxCalculationMode` to type `OrderImportDraft`
- added property `key` to type `ReturnItem`
- added property `key` to type `ReturnItemDraft`
- added property `customLineItemKey` to type `OrderImportCustomLineItemStateAction`
- added property `lineItemKey` to type `OrderImportLineItemStateAction`
- added property `customLineItemKey` to type `OrderSetCustomLineItemCustomFieldAction`
- added property `customLineItemKey` to type `OrderSetCustomLineItemCustomTypeAction`
- added property `customLineItemKey` to type `OrderSetCustomLineItemShippingDetailsAction`
- added property `returnItemKey` to type `OrderSetReturnItemCustomFieldAction`
- added property `returnItemKey` to type `OrderSetReturnItemCustomTypeAction`
- added property `returnItemKey` to type `OrderSetReturnPaymentStateAction`
- added property `returnItemKey` to type `OrderSetReturnShipmentStateAction`
- added property `customLineItemKey` to type `OrderTransitionCustomLineItemStateAction`
- added property `lineItemKey` to type `OrderTransitionLineItemStateAction`
</details>
Expand All @@ -77,6 +101,12 @@
<details>
<summary>Required Property(s)</summary>

- :warning: changed property `associateRoleAssignments` of type `AssociateDraft` to be required
- :warning: changed property `paymentState` of type `StagedOrderChangePaymentStateAction` to be required
- :warning: changed property `shipmentState` of type `StagedOrderChangeShipmentStateAction` to be required
- :warning: changed property `paymentState` of type `OrderChangePaymentStateAction` to be required
- :warning: changed property `shipmentState` of type `OrderChangeShipmentStateAction` to be required
- changed property `roles` of type `Associate` to be optional
- changed property `customLineItemId` of type `CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction` to be optional
- changed property `customLineItemId` of type `CartChangeCustomLineItemMoneyAction` to be optional
- changed property `customLineItemId` of type `CartChangeCustomLineItemPriceModeAction` to be optional
Expand All @@ -87,6 +117,8 @@
- changed property `customLineItemId` of type `CartSetCustomLineItemShippingDetailsAction` to be optional
- changed property `customLineItemId` of type `CartSetCustomLineItemTaxAmountAction` to be optional
- changed property `customLineItemId` of type `CartSetCustomLineItemTaxRateAction` to be optional
- changed property `centAmount` of type `CentPrecisionMoneyDraft` to be optional
- changed property `centAmount` of type `TypedMoneyDraft` to be optional
- changed property `comment` of type `MyQuoteRequestDraft` to be optional
- changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemMoneyAction` to be optional
- changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemQuantityAction` to be optional
Expand All @@ -98,6 +130,10 @@
- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemShippingDetailsAction` to be optional
- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxAmountAction` to be optional
- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxRateAction` to be optional
- changed property `returnItemId` of type `StagedOrderSetReturnItemCustomFieldAction` to be optional
- changed property `returnItemId` of type `StagedOrderSetReturnItemCustomTypeAction` to be optional
- changed property `returnItemId` of type `StagedOrderSetReturnPaymentStateAction` to be optional
- changed property `returnItemId` of type `StagedOrderSetReturnShipmentStateAction` to be optional
- changed property `customLineItemId` of type `StagedOrderTransitionCustomLineItemStateAction` to be optional
- changed property `lineItemId` of type `StagedOrderTransitionLineItemStateAction` to be optional
- changed property `priceMode` of type `CustomLineItemImportDraft` to be optional
Expand All @@ -106,27 +142,26 @@
- changed property `customLineItemId` of type `OrderSetCustomLineItemCustomFieldAction` to be optional
- changed property `customLineItemId` of type `OrderSetCustomLineItemCustomTypeAction` to be optional
- changed property `customLineItemId` of type `OrderSetCustomLineItemShippingDetailsAction` to be optional
- changed property `returnItemId` of type `OrderSetReturnItemCustomFieldAction` to be optional
- changed property `returnItemId` of type `OrderSetReturnItemCustomTypeAction` to be optional
- changed property `returnItemId` of type `OrderSetReturnPaymentStateAction` to be optional
- changed property `returnItemId` of type `OrderSetReturnShipmentStateAction` to be optional
- changed property `customLineItemId` of type `OrderTransitionCustomLineItemStateAction` to be optional
- changed property `lineItemId` of type `OrderTransitionLineItemStateAction` to be optional
- changed property `comment` of type `QuoteRequestDraft` to be optional
- :warning: changed property `paymentState` of type `StagedOrderChangePaymentStateAction` to be required
- :warning: changed property `shipmentState` of type `StagedOrderChangeShipmentStateAction` to be required
- :warning: changed property `paymentState` of type `OrderChangePaymentStateAction` to be required
- :warning: changed property `shipmentState` of type `OrderChangeShipmentStateAction` to be required
</details>


<details>
<summary>Changed Property(s)</summary>

- :warning: changed property `country` of type `StagedOrder` from type `string` to `CountryCode`
- :warning: changed property `locale` of type `StagedOrder` from type `string` to `Locale`
- :warning: changed property `country` of type `StagedOrderSetCountryAction` from type `string` to `CountryCode`
- :warning: changed property `locale` of type `StagedOrderSetLocaleAction` from type `string` to `Locale`
- :warning: changed property `country` of type `Order` from type `string` to `CountryCode`
- :warning: changed property `locale` of type `Order` from type `string` to `Locale`
- :warning: changed property `country` of type `OrderImportDraft` from type `string` to `CountryCode`
- :warning: changed property `locale` of type `OrderSetLocaleAction` from type `string` to `Locale`
<summary>Deprecated Property(s)</summary>

- property `Associate::roles` is removed
- property `AssociateDraft::roles` is removed
- property `IndividualExclusionProductSelectionType::type` is removed
- property `IndividualProductSelectionType::type` is removed
- property `ProductSelection::type` is removed
- property `ProductSelectionDraft::type` is removed
- property `ProductSelectionType::type` is removed
</details>


Expand All @@ -139,13 +174,24 @@


<details>
<summary>Removed Type(s)</summary>

- :warning: removed type `CartSetDeliveryAddressCustomFieldAction`
- :warning: removed type `CartSetDeliveryAddressCustomTypeAction`
- :warning: removed type `BusinessUnitParentUnitChangedMessage`
- :warning: removed type `BusinessUnitParentUnitChangedMessagePayload`
- :warning: removed type `OrderResourceIdentifier`
<summary>Removed QueryParameter(s)</summary>

- :warning: removed query parameter `expand` from method `get /{projectKey}/subscriptions`
- :warning: removed query parameter `expand` from method `post /{projectKey}/subscriptions`
- :warning: removed query parameter `expand` from method `get /{projectKey}/extensions`
- :warning: removed query parameter `expand` from method `post /{projectKey}/extensions`
- :warning: removed query parameter `expand` from method `get /{projectKey}/subscriptions/key={key}`
- :warning: removed query parameter `expand` from method `post /{projectKey}/subscriptions/key={key}`
- :warning: removed query parameter `expand` from method `delete /{projectKey}/subscriptions/key={key}`
- :warning: removed query parameter `expand` from method `get /{projectKey}/subscriptions/{ID}`
- :warning: removed query parameter `expand` from method `post /{projectKey}/subscriptions/{ID}`
- :warning: removed query parameter `expand` from method `delete /{projectKey}/subscriptions/{ID}`
- :warning: removed query parameter `expand` from method `get /{projectKey}/extensions/key={key}`
- :warning: removed query parameter `expand` from method `post /{projectKey}/extensions/key={key}`
- :warning: removed query parameter `expand` from method `delete /{projectKey}/extensions/key={key}`
- :warning: removed query parameter `expand` from method `get /{projectKey}/extensions/{ID}`
- :warning: removed query parameter `expand` from method `post /{projectKey}/extensions/{ID}`
- :warning: removed query parameter `expand` from method `delete /{projectKey}/extensions/{ID}`
</details>


Expand All @@ -155,23 +201,49 @@
- added type `CartDiscountAddStoreAction`
- added type `CartDiscountRemoveStoreAction`
- added type `CartDiscountSetStoresAction`
- added type `ContentTooLargeError`
- added type `MaxCartDiscountsReachedError`
- added type `MaxStoreReferencesReachedError`
- added type `StoreCartDiscountsLimitReachedError`
- added type `GraphQLContentTooLargeError`
- added type `GraphQLMaxCartDiscountsReachedError`
- added type `GraphQLMaxStoreReferencesReachedError`
- added type `GraphQLStoreCartDiscountsLimitReachedError`
- added type `BusinessUnitParentChangedMessage`
- added type `OrderCustomFieldAddedMessage`
- added type `OrderCustomFieldChangedMessage`
- added type `OrderCustomFieldRemovedMessage`
- added type `OrderCustomTypeRemovedMessage`
- added type `OrderCustomTypeSetMessage`
- added type `BusinessUnitParentChangedMessagePayload`
- added type `OrderCustomFieldAddedMessagePayload`
- added type `OrderCustomFieldChangedMessagePayload`
- added type `OrderCustomFieldRemovedMessagePayload`
- added type `OrderCustomTypeRemovedMessagePayload`
- added type `OrderCustomTypeSetMessagePayload`
- added type `StagedOrderSetDirectDiscountsAction`
- added type `StagedOrderSetStoreAction`
</details>


<details>
<summary>Added Enum(s)</summary>
<summary>Deprecated Type(s)</summary>

- added enum `associate-role` to type `ChangeSubscriptionResourceTypeId`
- type `AssociateRoleDeprecated` is removed
- type `IndividualExclusionProductSelectionType` is removed
- type `IndividualProductSelectionType` is removed
- type `ProductSelectionTypeEnum` is removed
</details>


<details>
<summary>Removed Type(s)</summary>

- :warning: removed type `CartSetDeliveryAddressCustomFieldAction`
- :warning: removed type `CartSetDeliveryAddressCustomTypeAction`
- :warning: removed type `BusinessUnitParentUnitChangedMessage`
- :warning: removed type `BusinessUnitParentUnitChangedMessagePayload`
- :warning: removed type `OrderResourceIdentifier`
</details>


Expand All @@ -188,13 +260,29 @@
- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().cartDiscounts().withId().delete()`
</details>


<details>
<summary>Added Resource(s)</summary>

- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts`
- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/key={key}`
- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/{ID}`
</details>


<details>
<summary>Added Enum(s)</summary>

- added enum `associate-role` to type `ChangeSubscriptionResourceTypeId`
</details>

**Import changes**

<details>
<summary>Required Property(s)</summary>

- changed property `addresses` of type `CustomerImport` to be optional
- :warning: changed property `key` of type `PriceDraftImport` to be required
- changed property `addresses` of type `CustomerImport` to be optional
</details>

**History changes**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ await AssertEventuallyAsync(async () =>
}
}
}).Build();
Assert.Contains("standalone-prices?where=key%20in%20%3Akeys&var.keys=166380&var.keys=166382&var.keys=166388&var.keys=166390",r.RequestUri.ToString());
Assert.Contains("standalone-prices?where=key%20in%20%3Akeys&var.keys=166380&var.keys=166382&var.keys=166388&var.keys=166390", r.RequestUri.ToString());
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ await WithProductType(apiRoot, async productType =>
await WithAsync(apiRoot, productDraftWithProductType, draftAction, func, CreateProduct, DeleteProduct);
});
}

public static async Task WithUpdateableProduct(ProjectApiRoot apiRoot, Func<IProduct, Task<IProduct>> func)
{
await WithUpdateableProduct(apiRoot, DefaultProductDraft, func);
}

public static async Task WithUpdateableProduct(ProjectApiRoot apiRoot, Func<ProductDraft, ProductDraft> draftAction, Func<IProduct, Task<IProduct>> func)
{
await WithProductType(apiRoot, async productType =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using commercetools.Sdk.Api.Models.Common;
using commercetools.Base.Client;
using commercetools.Sdk.Api.Client;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using commercetools.Base.Client;
using commercetools.Sdk.Api;
using commercetools.Sdk.Api.Client;
using commercetools.Sdk.GraphQL.Api;
Expand Down Expand Up @@ -28,8 +27,8 @@ public async Task GraphQLQuery()


var client = provider.GetService<ProjectApiRoot>().GraphQLClient();
var response = await client.Query( o => o.Products(selector: r => new { results = r.Results(product => new { product.Id }) }));

var response = await client.Query(o => o.Products(selector: r => new { results = r.Results(product => new { product.Id }) }));

Assert.NotNull(response.Data?.results);
Assert.Null(response.Errors);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections.Concurrent;
using System.Text;
using Microsoft.Extensions.Logging;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Concurrent;
using System.Linq;
using Microsoft.Extensions.Logging;

namespace commercetools.GraphQL.Api.IntegrationTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Linq;

namespace commercetools.GraphQL.Api.IntegrationTests
{
public static class TestingUtility
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,6 @@ public void WithMethods(HttpRequestMessage request, string httpMethod, string ur
public static IEnumerable<object[]> GetData()
{
return new List<object[]> {
new Object[] {
ApiRoot
.WithProjectKey("test_projectKey")
.Extensions()
.WithId("test_ID")
.Get()
.WithExpand("expand")
.Build(),
"Get",
"/test_projectKey/extensions/test_ID?expand=expand",
},
new Object[] {
ApiRoot
.WithProjectKey("test_projectKey")
Expand All @@ -40,17 +29,6 @@ public static IEnumerable<object[]> GetData()
"Get",
"/test_projectKey/extensions/test_ID",
},
new Object[] {
ApiRoot
.WithProjectKey("test_projectKey")
.Extensions()
.WithId("test_ID")
.Post(null)
.WithExpand("expand")
.Build(),
"Post",
"/test_projectKey/extensions/test_ID?expand=expand",
},
new Object[] {
ApiRoot
.WithProjectKey("test_projectKey")
Expand All @@ -72,17 +50,6 @@ public static IEnumerable<object[]> GetData()
"Delete",
"/test_projectKey/extensions/test_ID?version=2",
},
new Object[] {
ApiRoot
.WithProjectKey("test_projectKey")
.Extensions()
.WithId("test_ID")
.Delete()
.WithExpand("expand")
.Build(),
"Delete",
"/test_projectKey/extensions/test_ID?expand=expand",
},
new Object[] {
ApiRoot
.WithProjectKey("test_projectKey")
Expand Down
Loading

0 comments on commit 189c406

Please sign in to comment.