diff --git a/.changeset/changes_api.md b/.changeset/changes_api.md new file mode 100644 index 000000000..427c7d7ee --- /dev/null +++ b/.changeset/changes_api.md @@ -0,0 +1,14 @@ +--- +'@commercetools/platform-sdk': minor +--- + +**Api changes** + +
+Added Type(s) + +- added type `ExactLockConflictError` +- added type `ValidityLockConflictError` +- added type `GraphQLExactLockConflictError` +- added type `GraphQLValidityLockConflictError` +
diff --git a/changes.md b/changes.md index 0fa3e9955..b273945cd 100644 --- a/changes.md +++ b/changes.md @@ -3,29 +3,8 @@
Added Type(s) -- added type `CartDiscountSetRecurringOrderScopeAction` -- added type `AnyOrder` -- added type `AnyOrderDraft` -- added type `ApplicableRecurrencePolicies` -- added type `ApplicableRecurrencePoliciesDraft` -- added type `NonRecurringOrdersOnly` -- added type `NonRecurringOrdersOnlyDraft` -- added type `RecurringOrderScope` -- added type `RecurringOrderScopeDraft` -- added type `RecurringOrdersOnly` -- added type `RecurringOrdersOnlyDraft` -
- -
-Required Property(s) - -- :warning: changed property `deleteDaysAfterLastModification` of type `CartsConfiguration` to be required -- :warning: changed property `deleteDaysAfterLastModification` of type `ShoppingListsConfiguration` to be required -
- -
-Added Property(s) - -- added property `recurringOrderScope` to type `CartDiscount` -- added property `recurringOrderScope` to type `CartDiscountDraft` +- added type `ExactLockConflictError` +- added type `ValidityLockConflictError` +- added type `GraphQLExactLockConflictError` +- added type `GraphQLValidityLockConflictError`
diff --git a/packages/platform-sdk/src/generated/client/standalone-prices/by-project-key-standalone-prices-by-id-request-builder.ts b/packages/platform-sdk/src/generated/client/standalone-prices/by-project-key-standalone-prices-by-id-request-builder.ts index 30d8c7fff..e6a363fc3 100644 --- a/packages/platform-sdk/src/generated/client/standalone-prices/by-project-key-standalone-prices-by-id-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/standalone-prices/by-project-key-standalone-prices-by-id-request-builder.ts @@ -66,6 +66,10 @@ export class ByProjectKeyStandalonePricesByIDRequestBuilder { this.args.executeRequest ) } + /** + * If a modification is already in progress for the exact combination of SKU and price scope fields, an [ExactLockConflict](ctp:api:type:ExactLockConflictError) or [ValidityLockConflict](ctp:api:type:ValidityLockConflictError) error is returned. + * + */ public post(methodArgs: { queryArgs?: { expand?: string | string[] diff --git a/packages/platform-sdk/src/generated/client/standalone-prices/by-project-key-standalone-prices-key-by-key-request-builder.ts b/packages/platform-sdk/src/generated/client/standalone-prices/by-project-key-standalone-prices-key-by-key-request-builder.ts index ff63eca1c..32de78f1d 100644 --- a/packages/platform-sdk/src/generated/client/standalone-prices/by-project-key-standalone-prices-key-by-key-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/standalone-prices/by-project-key-standalone-prices-key-by-key-request-builder.ts @@ -66,6 +66,10 @@ export class ByProjectKeyStandalonePricesKeyByKeyRequestBuilder { this.args.executeRequest ) } + /** + * If a modification is already in progress for the exact combination of SKU and price scope fields, an [ExactLockConflict](ctp:api:type:ExactLockConflictError) or [ValidityLockConflict](ctp:api:type:ValidityLockConflictError) error is returned. + * + */ public post(methodArgs: { queryArgs?: { expand?: string | string[] diff --git a/packages/platform-sdk/src/generated/client/standalone-prices/by-project-key-standalone-prices-request-builder.ts b/packages/platform-sdk/src/generated/client/standalone-prices/by-project-key-standalone-prices-request-builder.ts index e2d59e081..d14ce13d0 100644 --- a/packages/platform-sdk/src/generated/client/standalone-prices/by-project-key-standalone-prices-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/standalone-prices/by-project-key-standalone-prices-request-builder.ts @@ -108,6 +108,7 @@ export class ByProjectKeyStandalonePricesRequestBuilder { * * - If the Standalone Price has the same price scope as an existing Standalone Price, a [DuplicateStandalonePriceScope](ctp:api:type:DuplicateStandalonePriceScopeError) error is returned. * - If the Standalone Price has overlapping validity periods within the same price scope, a [OverlappingStandalonePriceValidity](ctp:api:type:OverlappingStandalonePriceValidityError) error is returned. A Price without validity period does not conflict with a Price defined for a time period. + * - If a modification is already in progress for the exact combination of SKU and price scope fields, an [ExactLockConflict](ctp:api:type:ExactLockConflictError) or [ValidityLockConflict](ctp:api:type:ValidityLockConflictError) error is returned. * */ public post(methodArgs: { diff --git a/packages/platform-sdk/src/generated/models/error.ts b/packages/platform-sdk/src/generated/models/error.ts index c605e4068..a3942e15d 100644 --- a/packages/platform-sdk/src/generated/models/error.ts +++ b/packages/platform-sdk/src/generated/models/error.ts @@ -27,6 +27,10 @@ import { OrderEditPreviewFailure } from './order-edit' import { Attribute, ProductReference } from './product' import { ProductSearchErrorResponse } from './product-search' import { ProductVariantSelection } from './product-selection' +import { + RecurrencePolicyReference, + RecurrencePolicyResourceIdentifier, +} from './recurrence-policy' import { StandalonePriceReference } from './standalone-price' import { StoreKeyReference } from './store' @@ -70,6 +74,7 @@ export type ErrorObject = | EnumKeyDoesNotExistError | EnumValueIsUsedError | EnumValuesMustMatchError + | ExactLockConflictError | ExpiredCustomerEmailTokenError | ExpiredCustomerPasswordTokenError | ExtensionBadResponseError @@ -127,6 +132,7 @@ export type ErrorObject = | ShippingMethodDoesNotMatchCartError | StoreCartDiscountsLimitReachedError | SyntaxErrorError + | ValidityLockConflictError export interface IErrorObject { [key: string]: any /** @@ -844,6 +850,74 @@ export interface AuthErrorResponse extends ErrorResponse { */ readonly errors: ErrorObject[] } +/** + * Returned when a modification is already in progress for the exact combination of SKU and price scope fields for a Standalone Price. + * Retry the same request after 300 ms. + * + * The error is returned as a failed response to: + * - [Create StandalonePrice](ctp:api:endpoint:/{projectKey}/standalone-prices:POST) + * - [Update StandalonePrice by ID](ctp:api:endpoint:/{projectKey}/standalone-prices/{id}:POST) + * - [Update StandalonePrice by Key](ctp:api:endpoint:/{projectKey}/standalone-prices/key={key}:POST) + * + */ +export interface ExactLockConflictError extends IErrorObject { + readonly code: 'ExactLockConflict' + [key: string]: any + /** + * `"Modification already in progress for the combination of SKU and price scope fields."` + * + * + */ + readonly message: string + /** + * SKU for which the modification conflict occurred. + * + * + */ + readonly sku: string + /** + * Currency code of the Standalone Price. + * + * + */ + readonly currency: string + /** + * Country code of the geographic location. + * + * + */ + readonly country?: string + /** + * [CustomerGroup](ctp:api:type:CustomerGroup) for which the Standalone Price is valid. + * + * + */ + readonly customerGroup?: CustomerGroupResourceIdentifier + /** + * [Channel](ctp:api:type:Channel) for which the Standalone Price is valid. + * + * + */ + readonly channel?: ChannelResourceIdentifier + /** + * Date and time (UTC) from which the Standalone Price is valid. + * + * + */ + readonly validFrom?: string + /** + * Date and time (UTC) until which the Standalone Price is valid. + * + * + */ + readonly validUntil?: string + /** + * [RecurrencePolicy](ctp:api:type:RecurrencePolicy) that applies to the Standalone Price. + * + * + */ + readonly recurrencePolicy?: RecurrencePolicyReference +} /** * Returned when the provided email token of the Customer has expired. * @@ -2136,6 +2210,62 @@ export interface SyntaxErrorError extends IErrorObject { */ readonly message: string } +/** + * Returned when a modification is already in progress for the combination of SKU and price scope fields (but potentially different validity period) for a Standalone Price. + * Retry the same request after 300 ms. + * + * The error is returned as a failed response to: + * - [Create StandalonePrice](ctp:api:endpoint:/{projectKey}/standalone-prices:POST) + * - [Update StandalonePrice by ID](ctp:api:endpoint:/{projectKey}/standalone-prices/{id}:POST) + * - [Update StandalonePrice by Key](ctp:api:endpoint:/{projectKey}/standalone-prices/key={key}:POST) + * + */ +export interface ValidityLockConflictError extends IErrorObject { + readonly code: 'ValidityLockConflict' + [key: string]: any + /** + * `"Modification already in progress for the combination of SKU, price scope fields (but potentially different validity period). Please retry after the current operation completes."` + * + * + */ + readonly message: string + /** + * SKU for which the modification conflict occurred. + * + * + */ + readonly sku: string + /** + * Currency code of the Standalone Price. + * + * + */ + readonly currency: string + /** + * Country code of the geographic location. + * + * + */ + readonly country?: string + /** + * [CustomerGroup](ctp:api:type:CustomerGroup) for which the Standalone Price is valid. + * + * + */ + readonly customerGroup?: CustomerGroupResourceIdentifier + /** + * [Channel](ctp:api:type:Channel) for which the Standalone Price is valid. + * + * + */ + readonly channel?: ChannelResourceIdentifier + /** + * [RecurrencePolicy](ctp:api:type:RecurrencePolicy) for which the Standalone Price is valid. + * + * + */ + readonly recurrencePolicy?: RecurrencePolicyResourceIdentifier +} export interface VariantValues { /** * SKU of the [ProductVariant](ctp:api:type:ProductVariant). @@ -2184,6 +2314,7 @@ export type GraphQLErrorObject = | GraphQLEnumKeyDoesNotExistError | GraphQLEnumValueIsUsedError | GraphQLEnumValuesMustMatchError + | GraphQLExactLockConflictError | GraphQLExpiredCustomerEmailTokenError | GraphQLExpiredCustomerPasswordTokenError | GraphQLExtensionBadResponseError @@ -2241,6 +2372,7 @@ export type GraphQLErrorObject = | GraphQLShippingMethodDoesNotMatchCartError | GraphQLStoreCartDiscountsLimitReachedError | GraphQLSyntaxErrorError + | GraphQLValidityLockConflictError export interface IGraphQLErrorObject { [key: string]: any /** @@ -2766,6 +2898,68 @@ export interface GraphQLEnumValuesMustMatchError extends IGraphQLErrorObject { readonly code: 'EnumValuesMustMatch' [key: string]: any } +/** + * Returned when a modification is already in progress for the exact combination of SKU and price scope fields for a Standalone Price. + * Retry the same request after 300 ms. + * + * The error is returned as a failed response to: + * - [Create StandalonePrice](ctp:api:endpoint:/{projectKey}/standalone-prices:POST) + * - [Update StandalonePrice by ID](ctp:api:endpoint:/{projectKey}/standalone-prices/{id}:POST) + * - [Update StandalonePrice by Key](ctp:api:endpoint:/{projectKey}/standalone-prices/key={key}:POST) + * + */ +export interface GraphQLExactLockConflictError extends IGraphQLErrorObject { + readonly code: 'ExactLockConflict' + [key: string]: any + /** + * SKU for which the modification conflict occurred. + * + * + */ + readonly sku: string + /** + * Currency code of the Standalone Price. + * + * + */ + readonly currency: string + /** + * Country code of the geographic location. + * + * + */ + readonly country?: string + /** + * [CustomerGroup](ctp:api:type:CustomerGroup) for which the Standalone Price is valid. + * + * + */ + readonly customerGroup?: CustomerGroupResourceIdentifier + /** + * [Channel](ctp:api:type:Channel) for which the Standalone Price is valid. + * + * + */ + readonly channel?: ChannelResourceIdentifier + /** + * Date and time (UTC) from which the Standalone Price is valid. + * + * + */ + readonly validFrom?: string + /** + * Date and time (UTC) until which the Standalone Price is valid. + * + * + */ + readonly validUntil?: string + /** + * [RecurrencePolicy](ctp:api:type:RecurrencePolicy) that applies to the Standalone Price. + * + * + */ + readonly recurrencePolicy?: RecurrencePolicyReference +} /** * Returned when the provided email token of the Customer has expired. * @@ -3715,3 +3909,53 @@ export interface GraphQLSyntaxErrorError extends IGraphQLErrorObject { readonly code: 'SyntaxError' [key: string]: any } +/** + * Returned when a modification is already in progress for the combination of SKU and price scope fields (but potentially different validity period) for a Standalone Price. + * Retry the same request after 300 ms. + * + * The error is returned as a failed response to: + * - [Create StandalonePrice](ctp:api:endpoint:/{projectKey}/standalone-prices:POST) + * - [Update StandalonePrice by ID](ctp:api:endpoint:/{projectKey}/standalone-prices/{id}:POST) + * - [Update StandalonePrice by Key](ctp:api:endpoint:/{projectKey}/standalone-prices/key={key}:POST) + * + */ +export interface GraphQLValidityLockConflictError extends IGraphQLErrorObject { + readonly code: 'ValidityLockConflict' + [key: string]: any + /** + * SKU for which the modification conflict occurred. + * + * + */ + readonly sku: string + /** + * Currency code of the Standalone Price. + * + * + */ + readonly currency: string + /** + * Country code of the geographic location. + * + * + */ + readonly country?: string + /** + * [CustomerGroup](ctp:api:type:CustomerGroup) for which the Standalone Price is valid. + * + * + */ + readonly customerGroup?: CustomerGroupResourceIdentifier + /** + * [Channel](ctp:api:type:Channel) for which the Standalone Price is valid. + * + * + */ + readonly channel?: ChannelResourceIdentifier + /** + * [RecurrencePolicy](ctp:api:type:RecurrencePolicy) for which the Standalone Price is valid. + * + * + */ + readonly recurrencePolicy?: RecurrencePolicyResourceIdentifier +} diff --git a/packages/platform-sdk/src/generated/models/standalone-price.ts b/packages/platform-sdk/src/generated/models/standalone-price.ts index 333251106..e1778e61e 100644 --- a/packages/platform-sdk/src/generated/models/standalone-price.ts +++ b/packages/platform-sdk/src/generated/models/standalone-price.ts @@ -565,6 +565,8 @@ export interface StandalonePriceSetPriceTiersAction * * As the validity dates are part of the price scope and are not allowed to overlap, this update might return the [DuplicateStandalonePriceScope](ctp:api:type:DuplicateStandalonePriceScopeError) and [OverlappingStandalonePriceValidity](ctp:api:type:OverlappingStandalonePriceValidityError) errors, respectively. A Price without validity period does not conflict with a Price defined for a time period. * + * If a modification is already in progress for the exact combination of SKU and price scope fields, an [ExactLockConflict](ctp:api:type:ExactLockConflictError) or a [ValidityLockConflict](ctp:api:type:ValidityLockConflictError) error is returned. + * */ export interface StandalonePriceSetValidFromAction extends IStandalonePriceUpdateAction { @@ -582,6 +584,8 @@ export interface StandalonePriceSetValidFromAction * * As the validity dates are part of the price scope and are not allowed to overlap, this update might return the [DuplicateStandalonePriceScope](ctp:api:type:DuplicateStandalonePriceScopeError) and [OverlappingStandalonePriceValidity](ctp:api:type:OverlappingStandalonePriceValidityError) errors, respectively. A Price without validity period does not conflict with a Price defined for a time period. * + * If a modification is already in progress for the exact combination of SKU and price scope fields, an [ExactLockConflict](ctp:api:type:ExactLockConflictError) or a [ValidityLockConflict](ctp:api:type:ValidityLockConflictError) error is returned. + * */ export interface StandalonePriceSetValidFromAndUntilAction extends IStandalonePriceUpdateAction { @@ -606,6 +610,8 @@ export interface StandalonePriceSetValidFromAndUntilAction * * As the validity dates are part of the price scope and are not allowed to overlap, this update might return the [DuplicateStandalonePriceScope](ctp:api:type:DuplicateStandalonePriceScopeError) and [OverlappingStandalonePriceValidity](ctp:api:type:OverlappingStandalonePriceValidityError) errors, respectively. A Price without validity period does not conflict with a Price defined for a time period. * + * If a modification is already in progress for the exact combination of SKU and price scope fields, an [ExactLockConflict](ctp:api:type:ExactLockConflictError) or a [ValidityLockConflict](ctp:api:type:ValidityLockConflictError) error is returned. + * */ export interface StandalonePriceSetValidUntilAction extends IStandalonePriceUpdateAction { diff --git a/references.txt b/references.txt index daac7b104..4688fa28d 100644 --- a/references.txt +++ b/references.txt @@ -512,3 +512,4 @@ a9c69a2e32f13e695d381fb1c492ee6ed7e6f046 da68d777f48ba0233a7542a5344d86ef185db481 d90411c7dae76245a17c90707bfd18b735f04a9c f3ae1f87cbf764a30d228bf4e01215405951d454 +7fe8fbd8d4276aa8a033b8cba92c68c695d808c2