diff --git a/changes.md b/changes.md index d0036a71175..b6b5f559135 100644 --- a/changes.md +++ b/changes.md @@ -13,6 +13,10 @@ - added type `CustomerAddCustomerGroupAssignmentAction` - added type `CustomerRemoveCustomerGroupAssignmentAction` - added type `CustomerSetCustomerGroupAssignmentsAction` +- added type `ExpiredCustomerEmailTokenError` +- added type `ExpiredCustomerPasswordTokenError` +- added type `GraphQLExpiredCustomerEmailTokenError` +- added type `GraphQLExpiredCustomerPasswordTokenError` - added type `BaseEvent` - added type `CheckoutOrderCreationFailedEvent` - added type `CheckoutPaymentAuthorizationCancelledEvent` @@ -129,7 +133,18 @@ - added property `inheritedStores` to type `Division` - added property `discountTypeCombination` to type `Cart` - added property `customerGroupAssignments` to type `Customer` +- added property `invalidateOlderTokens` to type `CustomerCreateEmailToken` +- added property `invalidateOlderTokens` to type `CustomerCreatePasswordResetToken` - added property `customerGroupAssignments` to type `CustomerDraft` +- added property `invalidateOlderTokens` to type `CustomerToken` +- added property `value` to type `CustomerEmailTokenCreatedMessage` +- added property `invalidateOlderTokens` to type `CustomerEmailTokenCreatedMessage` +- added property `value` to type `CustomerPasswordTokenCreatedMessage` +- added property `invalidateOlderTokens` to type `CustomerPasswordTokenCreatedMessage` +- added property `value` to type `CustomerEmailTokenCreatedMessagePayload` +- added property `invalidateOlderTokens` to type `CustomerEmailTokenCreatedMessagePayload` +- added property `value` to type `CustomerPasswordTokenCreatedMessagePayload` +- added property `invalidateOlderTokens` to type `CustomerPasswordTokenCreatedMessagePayload` - added property `discountTypeCombination` to type `StagedOrder` - added property `discountTypeCombination` to type `Order` - added property `priceCustomerGroupAssignments` to type `ProductSearchProjectionParams` diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersEmailConfirmTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersEmailConfirmTest.php index 6d586f7ea8a..f77e50b2979 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersEmailConfirmTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersEmailConfirmTest.php @@ -148,7 +148,7 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 400 ], - 'ByProjectKeyCustomersEmailConfirmPost_401' => [ + 'ByProjectKeyCustomersEmailConfirmPost_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -156,9 +156,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->emailConfirm() ->post(null); }, - 401 + 404 ], - 'ByProjectKeyCustomersEmailConfirmPost_403' => [ + 'ByProjectKeyCustomersEmailConfirmPost_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -166,9 +166,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->emailConfirm() ->post(null); }, - 403 + 401 ], - 'ByProjectKeyCustomersEmailConfirmPost_404' => [ + 'ByProjectKeyCustomersEmailConfirmPost_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -176,7 +176,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->emailConfirm() ->post(null); }, - 404 + 403 ], 'ByProjectKeyCustomersEmailConfirmPost_500' => [ function (ApiRequestBuilder $builder): RequestInterface { diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersEmailTokenByEmailTokenTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersEmailTokenByEmailTokenTest.php index 909b25ded50..4fa630a3393 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersEmailTokenByEmailTokenTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersEmailTokenByEmailTokenTest.php @@ -160,7 +160,7 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 400 ], - 'ByProjectKeyCustomersEmailTokenByEmailTokenGet_401' => [ + 'ByProjectKeyCustomersEmailTokenByEmailTokenGet_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -168,9 +168,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withEmailToken("emailToken") ->get(); }, - 401 + 404 ], - 'ByProjectKeyCustomersEmailTokenByEmailTokenGet_403' => [ + 'ByProjectKeyCustomersEmailTokenByEmailTokenGet_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -178,9 +178,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withEmailToken("emailToken") ->get(); }, - 403 + 401 ], - 'ByProjectKeyCustomersEmailTokenByEmailTokenGet_404' => [ + 'ByProjectKeyCustomersEmailTokenByEmailTokenGet_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -188,7 +188,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withEmailToken("emailToken") ->get(); }, - 404 + 403 ], 'ByProjectKeyCustomersEmailTokenByEmailTokenGet_500' => [ function (ApiRequestBuilder $builder): RequestInterface { diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersPasswordResetTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersPasswordResetTest.php index bb8f86cce68..999f0789747 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersPasswordResetTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersPasswordResetTest.php @@ -148,7 +148,7 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 400 ], - 'ByProjectKeyCustomersPasswordResetPost_401' => [ + 'ByProjectKeyCustomersPasswordResetPost_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -156,9 +156,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->passwordReset() ->post(null); }, - 401 + 404 ], - 'ByProjectKeyCustomersPasswordResetPost_403' => [ + 'ByProjectKeyCustomersPasswordResetPost_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -166,9 +166,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->passwordReset() ->post(null); }, - 403 + 401 ], - 'ByProjectKeyCustomersPasswordResetPost_404' => [ + 'ByProjectKeyCustomersPasswordResetPost_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -176,7 +176,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->passwordReset() ->post(null); }, - 404 + 403 ], 'ByProjectKeyCustomersPasswordResetPost_500' => [ function (ApiRequestBuilder $builder): RequestInterface { diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersPasswordTokenByPasswordTokenTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersPasswordTokenByPasswordTokenTest.php index 761733dea31..1afb13a2bb4 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersPasswordTokenByPasswordTokenTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersPasswordTokenByPasswordTokenTest.php @@ -160,7 +160,7 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 400 ], - 'ByProjectKeyCustomersPasswordTokenByPasswordTokenGet_401' => [ + 'ByProjectKeyCustomersPasswordTokenByPasswordTokenGet_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -168,9 +168,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withPasswordToken("passwordToken") ->get(); }, - 401 + 404 ], - 'ByProjectKeyCustomersPasswordTokenByPasswordTokenGet_403' => [ + 'ByProjectKeyCustomersPasswordTokenByPasswordTokenGet_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -178,9 +178,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withPasswordToken("passwordToken") ->get(); }, - 403 + 401 ], - 'ByProjectKeyCustomersPasswordTokenByPasswordTokenGet_404' => [ + 'ByProjectKeyCustomersPasswordTokenByPasswordTokenGet_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -188,7 +188,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withPasswordToken("passwordToken") ->get(); }, - 404 + 403 ], 'ByProjectKeyCustomersPasswordTokenByPasswordTokenGet_500' => [ function (ApiRequestBuilder $builder): RequestInterface { diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmTest.php index c5d7bf1dee5..3c9e934915f 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmTest.php @@ -152,7 +152,7 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 400 ], - 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmPost_401' => [ + 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmPost_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -161,9 +161,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->emailConfirm() ->post(null); }, - 401 + 404 ], - 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmPost_403' => [ + 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmPost_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -172,9 +172,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->emailConfirm() ->post(null); }, - 403 + 401 ], - 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmPost_404' => [ + 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmPost_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -183,7 +183,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->emailConfirm() ->post(null); }, - 404 + 403 ], 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmPost_500' => [ function (ApiRequestBuilder $builder): RequestInterface { diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenTest.php index de1487474b7..286d659784f 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenTest.php @@ -165,7 +165,7 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 400 ], - 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenGet_401' => [ + 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenGet_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -174,9 +174,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withEmailToken("emailToken") ->get(); }, - 401 + 404 ], - 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenGet_403' => [ + 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenGet_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -185,9 +185,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withEmailToken("emailToken") ->get(); }, - 403 + 401 ], - 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenGet_404' => [ + 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenGet_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -196,7 +196,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withEmailToken("emailToken") ->get(); }, - 404 + 403 ], 'ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenGet_500' => [ function (ApiRequestBuilder $builder): RequestInterface { diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetTest.php index 6945e6dee7c..45d51500003 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetTest.php @@ -152,7 +152,7 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 400 ], - 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetPost_401' => [ + 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetPost_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -161,9 +161,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->passwordReset() ->post(null); }, - 401 + 404 ], - 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetPost_403' => [ + 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetPost_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -172,9 +172,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->passwordReset() ->post(null); }, - 403 + 401 ], - 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetPost_404' => [ + 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetPost_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -183,7 +183,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->passwordReset() ->post(null); }, - 404 + 403 ], 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetPost_500' => [ function (ApiRequestBuilder $builder): RequestInterface { diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenTest.php index 301f892f8c7..71d8730eb0c 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenTest.php @@ -165,7 +165,7 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 400 ], - 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenGet_401' => [ + 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenGet_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -174,9 +174,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withPasswordToken("passwordToken") ->get(); }, - 401 + 404 ], - 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenGet_403' => [ + 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenGet_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -185,9 +185,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withPasswordToken("passwordToken") ->get(); }, - 403 + 401 ], - 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenGet_404' => [ + 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenGet_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -196,7 +196,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withPasswordToken("passwordToken") ->get(); }, - 404 + 403 ], 'ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenGet_500' => [ function (ApiRequestBuilder $builder): RequestInterface { diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmTest.php index 5d4480d361b..a2947875a29 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmTest.php @@ -152,7 +152,7 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 400 ], - 'ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmPost_401' => [ + 'ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmPost_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -161,9 +161,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->emailConfirm() ->post(null); }, - 401 + 404 ], - 'ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmPost_403' => [ + 'ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmPost_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -172,9 +172,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->emailConfirm() ->post(null); }, - 403 + 401 ], - 'ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmPost_404' => [ + 'ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmPost_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -183,7 +183,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->emailConfirm() ->post(null); }, - 404 + 403 ], 'ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmPost_500' => [ function (ApiRequestBuilder $builder): RequestInterface { diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMePasswordResetTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMePasswordResetTest.php index 0e34333d184..0eb2300fdd9 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMePasswordResetTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMePasswordResetTest.php @@ -156,7 +156,7 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 400 ], - 'ByProjectKeyInStoreKeyByStoreKeyMePasswordResetPost_401' => [ + 'ByProjectKeyInStoreKeyByStoreKeyMePasswordResetPost_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -166,9 +166,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->reset() ->post(null); }, - 401 + 404 ], - 'ByProjectKeyInStoreKeyByStoreKeyMePasswordResetPost_403' => [ + 'ByProjectKeyInStoreKeyByStoreKeyMePasswordResetPost_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -178,9 +178,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->reset() ->post(null); }, - 403 + 401 ], - 'ByProjectKeyInStoreKeyByStoreKeyMePasswordResetPost_404' => [ + 'ByProjectKeyInStoreKeyByStoreKeyMePasswordResetPost_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -190,7 +190,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->reset() ->post(null); }, - 404 + 403 ], 'ByProjectKeyInStoreKeyByStoreKeyMePasswordResetPost_500' => [ function (ApiRequestBuilder $builder): RequestInterface { diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeEmailConfirmTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeEmailConfirmTest.php index 91095733c29..54d9013c784 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeEmailConfirmTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeEmailConfirmTest.php @@ -148,7 +148,7 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 400 ], - 'ByProjectKeyMeEmailConfirmPost_401' => [ + 'ByProjectKeyMeEmailConfirmPost_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -156,9 +156,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->emailConfirm() ->post(null); }, - 401 + 404 ], - 'ByProjectKeyMeEmailConfirmPost_403' => [ + 'ByProjectKeyMeEmailConfirmPost_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -166,9 +166,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->emailConfirm() ->post(null); }, - 403 + 401 ], - 'ByProjectKeyMeEmailConfirmPost_404' => [ + 'ByProjectKeyMeEmailConfirmPost_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -176,7 +176,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->emailConfirm() ->post(null); }, - 404 + 403 ], 'ByProjectKeyMeEmailConfirmPost_500' => [ function (ApiRequestBuilder $builder): RequestInterface { diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMePasswordResetTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMePasswordResetTest.php index a440bed3286..85a75f86c04 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMePasswordResetTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMePasswordResetTest.php @@ -152,7 +152,7 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 400 ], - 'ByProjectKeyMePasswordResetPost_401' => [ + 'ByProjectKeyMePasswordResetPost_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -161,9 +161,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->reset() ->post(null); }, - 401 + 404 ], - 'ByProjectKeyMePasswordResetPost_403' => [ + 'ByProjectKeyMePasswordResetPost_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -172,9 +172,9 @@ function (ApiRequestBuilder $builder): RequestInterface { ->reset() ->post(null); }, - 403 + 401 ], - 'ByProjectKeyMePasswordResetPost_404' => [ + 'ByProjectKeyMePasswordResetPost_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") @@ -183,7 +183,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->reset() ->post(null); }, - 404 + 403 ], 'ByProjectKeyMePasswordResetPost_500' => [ function (ApiRequestBuilder $builder): RequestInterface { diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md index 9fa80249422..0a8eed1e199 100644 --- a/lib/commercetools-api/docs/RequestBuilder.md +++ b/lib/commercetools-api/docs/RequestBuilder.md @@ -3080,6 +3080,8 @@ Use this method to verify a global Customer's email during their [email verifica Verifying the email of the Customer produces the [CustomerEmailVerified](ctp:api:type:CustomerEmailVerifiedMessage) Message. +After the email is verified, all email tokens issued previously through the [email verification flow](/../api/projects/customers#email-verification-of-customer) are invalidated. This invalidation of tokens is [eventually consistent](/../api/general-concepts#eventual-consistency). + ### Example ```php @@ -3097,6 +3099,7 @@ $request = $builder Use this method to create an email token for a global Customer during their [email verification process](/../api/customers-overview#customer-email-verification). Creating an email token for the Customer produces the [CustomerEmailTokenCreated](ctp:api:type:CustomerEmailTokenCreatedMessage) Message. +The Message will include the token's value, if the token's validity is 60 minutes or less. ### Example @@ -3207,10 +3210,10 @@ $request = $builder Use this method to reset a global Customer's password during their [password reset process](/../api/customers-overview#customer-password-reset). -After the password is reset, any previously issued access and/or refresh tokens created through the [password flow](/authorization#password-flow) or [refresh token flow](/authorization#refresh-token-flow) are invalidated. - Resetting the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. +After the password is reset, all password tokens issued previously through the [password reset flow](/../api/projects/customers#password-reset-of-customer) are invalidated. In addition, any access and refresh tokens issued previously through the [password flow](/../api/authorization#password-flow) and [refresh token flow](/../api/authorization#refresh-token-flow) are invalidated. This invalidation of tokens is [eventually consistent](/../api/general-concepts#eventual-consistency). + ### Example ```php @@ -3227,7 +3230,8 @@ $request = $builder Use this method to create a password reset token for a global Customer during their [password reset process](/../api/customers-overview#customer-password-reset). -Creating a password reset token does not invalidate existing tokens. +Creating a password reset token for the Customer produces the [CustomerPasswordTokenCreated](ctp:api:type:CustomerPasswordTokenCreatedMessage) Message. +The Message will include the token's value, if the token's validity is 60 minutes or less. ### Example @@ -4465,6 +4469,8 @@ Verifying the email of the Customer produces the [CustomerEmailVerified](ctp:api If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +After the email is verified, all email tokens issued previously through the [email verification flow](/../api/projects/customers#email-verification-of-customer) are invalidated. This invalidation of tokens is [eventually consistent](/../api/general-concepts#eventual-consistency). + ### Example ```php @@ -4484,6 +4490,9 @@ Use this method to create an email token for a Store-specific Customer during th If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +Creating an email token for the Customer produces the [CustomerEmailTokenCreated](ctp:api:type:CustomerEmailTokenCreatedMessage) Message. +The Message will include the token's value, if the token's validity is 60 minutes or less. + ### Example ```php @@ -4608,10 +4617,10 @@ $request = $builder Use this method to reset a Store-specific Customer's password during their [password reset process](/../api/customers-overview#customer-password-reset). -After the password is reset, any previously issued access and/or refresh tokens created through the [password flow](/authorization#password-flow) or [refresh token flow](/authorization#refresh-token-flow) are invalidated. - Resetting the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. +After the password is reset, all password tokens issued previously through the [password reset flow](/../api/projects/customers#password-reset-of-customer) are invalidated. In addition, any access and refresh tokens issued previously through the [password flow](/../api/authorization#password-flow) and [refresh token flow](/../api/authorization#refresh-token-flow) are invalidated. This invalidation of tokens is [eventually consistent](/../api/general-concepts#eventual-consistency). + If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), then this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. @@ -4631,10 +4640,11 @@ $request = $builder Use this method to create a password reset token for a Store-specific Customer during their [password reset process](/../api/customers-overview#customer-password-reset). -Creating a password reset token does not invalidate existing tokens. - If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +Creating a password reset token for the Customer produces the [CustomerPasswordTokenCreated](ctp:api:type:CustomerPasswordTokenCreatedMessage) Message. +The Message will include the token's value, if the token's validity is 60 minutes or less. + ### Example ```php @@ -4956,6 +4966,8 @@ $request = $builder This is the last step in the [email verification process of a Customer](/../api/projects/customers#email-verification-of-customer-in-store). Returns a `200 OK` status if successful. +After the email is verified, all email tokens issued previously through the [email verification flow](/../api/projects/customers#email-verification-of-customer) are invalidated. This invalidation of tokens is [eventually consistent](/../api/general-concepts#eventual-consistency). + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#composable-commerce-oauth) scope. @@ -5158,6 +5170,8 @@ This is the last step in the [password reset process of the authenticated Custom Resetting a password produces the Customer [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. +After the password is reset, all password tokens issued previously through the [password reset flow](/../api/projects/customers#password-reset-of-customer) are invalidated. In addition, any access and refresh tokens issued previously through the [password flow](/../api/authorization#password-flow) and [refresh token flow](/../api/authorization#refresh-token-flow) are invalidated. This invalidation of tokens is [eventually consistent](/../api/general-concepts#eventual-consistency). + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#composable-commerce-oauth) scope. @@ -7351,6 +7365,8 @@ $request = $builder This is the last step in the [email verification process of a Customer](/../api/projects/customers#email-verification-of-customer). +After the email is verified, all email tokens issued previously through the [email verification flow](/../api/projects/customers#email-verification-of-customer) are invalidated. This invalidation of tokens is [eventually consistent](/../api/general-concepts#eventual-consistency). + ### Example ```php @@ -7563,6 +7579,8 @@ This is the last step in the [password reset process of a Customer](/../api/proj Resetting a password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. +After the password is reset, all password tokens issued previously through the [password reset flow](/../api/projects/customers#password-reset-of-customer) are invalidated. In addition, any access and refresh tokens issued previously through the [password flow](/../api/authorization#password-flow) and [refresh token flow](/../api/authorization#refresh-token-flow) are invalidated. This invalidation of tokens is [eventually consistent](/../api/general-concepts#eventual-consistency). + ### Example ```php diff --git a/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailToken.php b/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailToken.php index 84daddebee7..1ffd07fc833 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailToken.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailToken.php @@ -16,6 +16,7 @@ interface CustomerCreateEmailToken extends JsonObject public const FIELD_ID = 'id'; public const FIELD_VERSION = 'version'; public const FIELD_TTL_MINUTES = 'ttlMinutes'; + public const FIELD_INVALIDATE_OLDER_TOKENS = 'invalidateOlderTokens'; /** *

Unique identifier of the Customer.

@@ -41,6 +42,14 @@ public function getVersion(); */ public function getTtlMinutes(); + /** + *

If set to true, all email tokens issued previously for the Customer will be invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens(); + /** * @param ?string $id */ @@ -55,4 +64,9 @@ public function setVersion(?int $version): void; * @param ?int $ttlMinutes */ public function setTtlMinutes(?int $ttlMinutes): void; + + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void; } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenBuilder.php index 8e7eb661df3..f55c66db717 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenBuilder.php @@ -38,6 +38,12 @@ final class CustomerCreateEmailTokenBuilder implements Builder */ private $ttlMinutes; + /** + + * @var ?bool + */ + private $invalidateOlderTokens; + /** *

Unique identifier of the Customer.

* @@ -71,6 +77,17 @@ public function getTtlMinutes() return $this->ttlMinutes; } + /** + *

If set to true, all email tokens issued previously for the Customer will be invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + return $this->invalidateOlderTokens; + } + /** * @param ?string $id * @return $this @@ -104,13 +121,25 @@ public function withTtlMinutes(?int $ttlMinutes) return $this; } + /** + * @param ?bool $invalidateOlderTokens + * @return $this + */ + public function withInvalidateOlderTokens(?bool $invalidateOlderTokens) + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + + return $this; + } + public function build(): CustomerCreateEmailToken { return new CustomerCreateEmailTokenModel( $this->id, $this->version, - $this->ttlMinutes + $this->ttlMinutes, + $this->invalidateOlderTokens ); } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenModel.php b/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenModel.php index 33edfa00186..8829be93357 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenModel.php @@ -37,6 +37,12 @@ final class CustomerCreateEmailTokenModel extends JsonObjectModel implements Cus */ protected $ttlMinutes; + /** + * + * @var ?bool + */ + protected $invalidateOlderTokens; + /** * @psalm-suppress MissingParamType @@ -44,11 +50,13 @@ final class CustomerCreateEmailTokenModel extends JsonObjectModel implements Cus public function __construct( ?string $id = null, ?int $version = null, - ?int $ttlMinutes = null + ?int $ttlMinutes = null, + ?bool $invalidateOlderTokens = null ) { $this->id = $id; $this->version = $version; $this->ttlMinutes = $ttlMinutes; + $this->invalidateOlderTokens = $invalidateOlderTokens; } /** @@ -111,6 +119,26 @@ public function getTtlMinutes() return $this->ttlMinutes; } + /** + *

If set to true, all email tokens issued previously for the Customer will be invalidated.

+ * + * + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + if (is_null($this->invalidateOlderTokens)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_INVALIDATE_OLDER_TOKENS); + if (is_null($data)) { + return null; + } + $this->invalidateOlderTokens = (bool) $data; + } + + return $this->invalidateOlderTokens; + } + /** * @param ?string $id @@ -135,4 +163,12 @@ public function setTtlMinutes(?int $ttlMinutes): void { $this->ttlMinutes = $ttlMinutes; } + + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + } } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetToken.php b/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetToken.php index 03edeb4f3d4..5d614f4538f 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetToken.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetToken.php @@ -15,6 +15,7 @@ interface CustomerCreatePasswordResetToken extends JsonObject { public const FIELD_EMAIL = 'email'; public const FIELD_TTL_MINUTES = 'ttlMinutes'; + public const FIELD_INVALIDATE_OLDER_TOKENS = 'invalidateOlderTokens'; /** *

Email address of the Customer treated as case-insensitive.

@@ -32,6 +33,14 @@ public function getEmail(); */ public function getTtlMinutes(); + /** + *

If set to true, all password tokens issued previously for the Customer will be invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens(); + /** * @param ?string $email */ @@ -41,4 +50,9 @@ public function setEmail(?string $email): void; * @param ?int $ttlMinutes */ public function setTtlMinutes(?int $ttlMinutes): void; + + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void; } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenBuilder.php index 65cf3788077..709e330a14b 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenBuilder.php @@ -32,6 +32,12 @@ final class CustomerCreatePasswordResetTokenBuilder implements Builder */ private $ttlMinutes; + /** + + * @var ?bool + */ + private $invalidateOlderTokens; + /** *

Email address of the Customer treated as case-insensitive.

* @@ -54,6 +60,17 @@ public function getTtlMinutes() return $this->ttlMinutes; } + /** + *

If set to true, all password tokens issued previously for the Customer will be invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + return $this->invalidateOlderTokens; + } + /** * @param ?string $email * @return $this @@ -76,12 +93,24 @@ public function withTtlMinutes(?int $ttlMinutes) return $this; } + /** + * @param ?bool $invalidateOlderTokens + * @return $this + */ + public function withInvalidateOlderTokens(?bool $invalidateOlderTokens) + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + + return $this; + } + public function build(): CustomerCreatePasswordResetToken { return new CustomerCreatePasswordResetTokenModel( $this->email, - $this->ttlMinutes + $this->ttlMinutes, + $this->invalidateOlderTokens ); } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenModel.php b/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenModel.php index 76816e84238..e3734e47f27 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenModel.php @@ -31,16 +31,24 @@ final class CustomerCreatePasswordResetTokenModel extends JsonObjectModel implem */ protected $ttlMinutes; + /** + * + * @var ?bool + */ + protected $invalidateOlderTokens; + /** * @psalm-suppress MissingParamType */ public function __construct( ?string $email = null, - ?int $ttlMinutes = null + ?int $ttlMinutes = null, + ?bool $invalidateOlderTokens = null ) { $this->email = $email; $this->ttlMinutes = $ttlMinutes; + $this->invalidateOlderTokens = $invalidateOlderTokens; } /** @@ -83,6 +91,26 @@ public function getTtlMinutes() return $this->ttlMinutes; } + /** + *

If set to true, all password tokens issued previously for the Customer will be invalidated.

+ * + * + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + if (is_null($this->invalidateOlderTokens)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_INVALIDATE_OLDER_TOKENS); + if (is_null($data)) { + return null; + } + $this->invalidateOlderTokens = (bool) $data; + } + + return $this->invalidateOlderTokens; + } + /** * @param ?string $email @@ -99,4 +127,12 @@ public function setTtlMinutes(?int $ttlMinutes): void { $this->ttlMinutes = $ttlMinutes; } + + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + } } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerToken.php b/lib/commercetools-api/src/Models/Customer/CustomerToken.php index 8213194c590..841c39046ca 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerToken.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerToken.php @@ -18,6 +18,7 @@ interface CustomerToken extends JsonObject public const FIELD_CUSTOMER_ID = 'customerId'; public const FIELD_VALUE = 'value'; public const FIELD_EXPIRES_AT = 'expiresAt'; + public const FIELD_INVALIDATE_OLDER_TOKENS = 'invalidateOlderTokens'; public const FIELD_CREATED_AT = 'createdAt'; public const FIELD_LAST_MODIFIED_AT = 'lastModifiedAt'; @@ -53,6 +54,14 @@ public function getValue(); */ public function getExpiresAt(); + /** + *

If true, all tokens issued previously for the Customer will be invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens(); + /** *

Date and time (UTC) the token was initially created.

* @@ -89,6 +98,11 @@ public function setValue(?string $value): void; */ public function setExpiresAt(?DateTimeImmutable $expiresAt): void; + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void; + /** * @param ?DateTimeImmutable $createdAt */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerTokenBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerTokenBuilder.php index 7fdd3ad9d95..be11d73c779 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerTokenBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerTokenBuilder.php @@ -45,6 +45,12 @@ final class CustomerTokenBuilder implements Builder */ private $expiresAt; + /** + + * @var ?bool + */ + private $invalidateOlderTokens; + /** * @var ?DateTimeImmutable @@ -101,6 +107,17 @@ public function getExpiresAt() return $this->expiresAt; } + /** + *

If true, all tokens issued previously for the Customer will be invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + return $this->invalidateOlderTokens; + } + /** *

Date and time (UTC) the token was initially created.

* @@ -167,6 +184,17 @@ public function withExpiresAt(?DateTimeImmutable $expiresAt) return $this; } + /** + * @param ?bool $invalidateOlderTokens + * @return $this + */ + public function withInvalidateOlderTokens(?bool $invalidateOlderTokens) + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + + return $this; + } + /** * @param ?DateTimeImmutable $createdAt * @return $this @@ -197,6 +225,7 @@ public function build(): CustomerToken $this->customerId, $this->value, $this->expiresAt, + $this->invalidateOlderTokens, $this->createdAt, $this->lastModifiedAt ); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerTokenModel.php b/lib/commercetools-api/src/Models/Customer/CustomerTokenModel.php index 2ad4bccc965..3e8e6003ed7 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerTokenModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerTokenModel.php @@ -44,6 +44,12 @@ final class CustomerTokenModel extends JsonObjectModel implements CustomerToken */ protected $expiresAt; + /** + * + * @var ?bool + */ + protected $invalidateOlderTokens; + /** * * @var ?DateTimeImmutable @@ -65,6 +71,7 @@ public function __construct( ?string $customerId = null, ?string $value = null, ?DateTimeImmutable $expiresAt = null, + ?bool $invalidateOlderTokens = null, ?DateTimeImmutable $createdAt = null, ?DateTimeImmutable $lastModifiedAt = null ) { @@ -72,6 +79,7 @@ public function __construct( $this->customerId = $customerId; $this->value = $value; $this->expiresAt = $expiresAt; + $this->invalidateOlderTokens = $invalidateOlderTokens; $this->createdAt = $createdAt; $this->lastModifiedAt = $lastModifiedAt; } @@ -160,6 +168,26 @@ public function getExpiresAt() return $this->expiresAt; } + /** + *

If true, all tokens issued previously for the Customer will be invalidated.

+ * + * + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + if (is_null($this->invalidateOlderTokens)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_INVALIDATE_OLDER_TOKENS); + if (is_null($data)) { + return null; + } + $this->invalidateOlderTokens = (bool) $data; + } + + return $this->invalidateOlderTokens; + } + /** *

Date and time (UTC) the token was initially created.

* @@ -241,6 +269,14 @@ public function setExpiresAt(?DateTimeImmutable $expiresAt): void $this->expiresAt = $expiresAt; } + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + } + /** * @param ?DateTimeImmutable $createdAt */ diff --git a/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php b/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php index b67434a5749..e8c833946c6 100644 --- a/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php +++ b/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php @@ -61,6 +61,8 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject 'EnumKeyDoesNotExist' => EnumKeyDoesNotExistErrorModel::class, 'EnumValueIsUsed' => EnumValueIsUsedErrorModel::class, 'EnumValuesMustMatch' => EnumValuesMustMatchErrorModel::class, + 'ExpiredCustomerEmailToken' => ExpiredCustomerEmailTokenErrorModel::class, + 'ExpiredCustomerPasswordToken' => ExpiredCustomerPasswordTokenErrorModel::class, 'ExtensionBadResponse' => ExtensionBadResponseErrorModel::class, 'ExtensionNoResponse' => ExtensionNoResponseErrorModel::class, 'ExtensionPredicateEvaluationFailed' => ExtensionPredicateEvaluationFailedErrorModel::class, diff --git a/lib/commercetools-api/src/Models/Error/ExpiredCustomerEmailTokenError.php b/lib/commercetools-api/src/Models/Error/ExpiredCustomerEmailTokenError.php new file mode 100644 index 00000000000..63fbe583fd8 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/ExpiredCustomerEmailTokenError.php @@ -0,0 +1,34 @@ +"The given email token has expired."

+ * + + * @return null|string + */ + public function getMessage(); + + /** + * @param ?string $message + */ + public function setMessage(?string $message): void; +} diff --git a/lib/commercetools-api/src/Models/Error/ExpiredCustomerEmailTokenErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ExpiredCustomerEmailTokenErrorBuilder.php new file mode 100644 index 00000000000..0bcf7bd0501 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/ExpiredCustomerEmailTokenErrorBuilder.php @@ -0,0 +1,63 @@ + + */ +final class ExpiredCustomerEmailTokenErrorBuilder implements Builder +{ + /** + + * @var ?string + */ + private $message; + + /** + *

"The given email token has expired."

+ * + + * @return null|string + */ + public function getMessage() + { + return $this->message; + } + + /** + * @param ?string $message + * @return $this + */ + public function withMessage(?string $message) + { + $this->message = $message; + + return $this; + } + + + public function build(): ExpiredCustomerEmailTokenError + { + return new ExpiredCustomerEmailTokenErrorModel( + $this->message + ); + } + + public static function of(): ExpiredCustomerEmailTokenErrorBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Error/ExpiredCustomerEmailTokenErrorCollection.php b/lib/commercetools-api/src/Models/Error/ExpiredCustomerEmailTokenErrorCollection.php new file mode 100644 index 00000000000..47f9cb9f7e1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/ExpiredCustomerEmailTokenErrorCollection.php @@ -0,0 +1,56 @@ + + * @method ExpiredCustomerEmailTokenError current() + * @method ExpiredCustomerEmailTokenError end() + * @method ExpiredCustomerEmailTokenError at($offset) + */ +class ExpiredCustomerEmailTokenErrorCollection extends ErrorObjectCollection +{ + /** + * @psalm-assert ExpiredCustomerEmailTokenError $value + * @psalm-param ExpiredCustomerEmailTokenError|stdClass $value + * @throws InvalidArgumentException + * + * @return ExpiredCustomerEmailTokenErrorCollection + */ + public function add($value) + { + if (!$value instanceof ExpiredCustomerEmailTokenError) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ExpiredCustomerEmailTokenError + */ + protected function mapper() + { + return function (?int $index): ?ExpiredCustomerEmailTokenError { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ExpiredCustomerEmailTokenError $data */ + $data = ExpiredCustomerEmailTokenErrorModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Error/ExpiredCustomerEmailTokenErrorModel.php b/lib/commercetools-api/src/Models/Error/ExpiredCustomerEmailTokenErrorModel.php new file mode 100644 index 00000000000..db4e1315421 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/ExpiredCustomerEmailTokenErrorModel.php @@ -0,0 +1,106 @@ +message = $message; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getCode() + { + if (is_null($this->code)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CODE); + if (is_null($data)) { + return null; + } + $this->code = (string) $data; + } + + return $this->code; + } + + /** + *

"The given email token has expired."

+ * + * + * @return null|string + */ + public function getMessage() + { + if (is_null($this->message)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_MESSAGE); + if (is_null($data)) { + return null; + } + $this->message = (string) $data; + } + + return $this->message; + } + + + /** + * @param ?string $message + */ + public function setMessage(?string $message): void + { + $this->message = $message; + } + + /** + * @return mixed + */ + public function by(string $key) + { + $data = $this->raw($key); + if (is_null($data)) { + return null; + } + + return $data; + } +} diff --git a/lib/commercetools-api/src/Models/Error/ExpiredCustomerPasswordTokenError.php b/lib/commercetools-api/src/Models/Error/ExpiredCustomerPasswordTokenError.php new file mode 100644 index 00000000000..0d023799b6f --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/ExpiredCustomerPasswordTokenError.php @@ -0,0 +1,34 @@ +"The given password token has expired."

+ * + + * @return null|string + */ + public function getMessage(); + + /** + * @param ?string $message + */ + public function setMessage(?string $message): void; +} diff --git a/lib/commercetools-api/src/Models/Error/ExpiredCustomerPasswordTokenErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ExpiredCustomerPasswordTokenErrorBuilder.php new file mode 100644 index 00000000000..8a023306010 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/ExpiredCustomerPasswordTokenErrorBuilder.php @@ -0,0 +1,63 @@ + + */ +final class ExpiredCustomerPasswordTokenErrorBuilder implements Builder +{ + /** + + * @var ?string + */ + private $message; + + /** + *

"The given password token has expired."

+ * + + * @return null|string + */ + public function getMessage() + { + return $this->message; + } + + /** + * @param ?string $message + * @return $this + */ + public function withMessage(?string $message) + { + $this->message = $message; + + return $this; + } + + + public function build(): ExpiredCustomerPasswordTokenError + { + return new ExpiredCustomerPasswordTokenErrorModel( + $this->message + ); + } + + public static function of(): ExpiredCustomerPasswordTokenErrorBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Error/ExpiredCustomerPasswordTokenErrorCollection.php b/lib/commercetools-api/src/Models/Error/ExpiredCustomerPasswordTokenErrorCollection.php new file mode 100644 index 00000000000..51fe4104b33 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/ExpiredCustomerPasswordTokenErrorCollection.php @@ -0,0 +1,56 @@ + + * @method ExpiredCustomerPasswordTokenError current() + * @method ExpiredCustomerPasswordTokenError end() + * @method ExpiredCustomerPasswordTokenError at($offset) + */ +class ExpiredCustomerPasswordTokenErrorCollection extends ErrorObjectCollection +{ + /** + * @psalm-assert ExpiredCustomerPasswordTokenError $value + * @psalm-param ExpiredCustomerPasswordTokenError|stdClass $value + * @throws InvalidArgumentException + * + * @return ExpiredCustomerPasswordTokenErrorCollection + */ + public function add($value) + { + if (!$value instanceof ExpiredCustomerPasswordTokenError) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ExpiredCustomerPasswordTokenError + */ + protected function mapper() + { + return function (?int $index): ?ExpiredCustomerPasswordTokenError { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ExpiredCustomerPasswordTokenError $data */ + $data = ExpiredCustomerPasswordTokenErrorModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Error/ExpiredCustomerPasswordTokenErrorModel.php b/lib/commercetools-api/src/Models/Error/ExpiredCustomerPasswordTokenErrorModel.php new file mode 100644 index 00000000000..62f58311a53 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/ExpiredCustomerPasswordTokenErrorModel.php @@ -0,0 +1,106 @@ +message = $message; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getCode() + { + if (is_null($this->code)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CODE); + if (is_null($data)) { + return null; + } + $this->code = (string) $data; + } + + return $this->code; + } + + /** + *

"The given password token has expired."

+ * + * + * @return null|string + */ + public function getMessage() + { + if (is_null($this->message)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_MESSAGE); + if (is_null($data)) { + return null; + } + $this->message = (string) $data; + } + + return $this->message; + } + + + /** + * @param ?string $message + */ + public function setMessage(?string $message): void + { + $this->message = $message; + } + + /** + * @return mixed + */ + public function by(string $key) + { + $data = $this->raw($key); + if (is_null($data)) { + return null; + } + + return $data; + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php b/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php index 067718cae79..646508a0b7f 100644 --- a/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php +++ b/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php @@ -55,6 +55,8 @@ final class GraphQLErrorObjectModel extends JsonObjectModel implements GraphQLEr 'EnumKeyDoesNotExist' => GraphQLEnumKeyDoesNotExistErrorModel::class, 'EnumValueIsUsed' => GraphQLEnumValueIsUsedErrorModel::class, 'EnumValuesMustMatch' => GraphQLEnumValuesMustMatchErrorModel::class, + 'ExpiredCustomerEmailToken' => GraphQLExpiredCustomerEmailTokenErrorModel::class, + 'ExpiredCustomerPasswordToken' => GraphQLExpiredCustomerPasswordTokenErrorModel::class, 'ExtensionBadResponse' => GraphQLExtensionBadResponseErrorModel::class, 'ExtensionNoResponse' => GraphQLExtensionNoResponseErrorModel::class, 'ExtensionPredicateEvaluationFailed' => GraphQLExtensionPredicateEvaluationFailedErrorModel::class, diff --git a/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerEmailTokenError.php b/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerEmailTokenError.php new file mode 100644 index 00000000000..1fd6355da95 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerEmailTokenError.php @@ -0,0 +1,21 @@ + + */ +final class GraphQLExpiredCustomerEmailTokenErrorBuilder implements Builder +{ + public function build(): GraphQLExpiredCustomerEmailTokenError + { + return new GraphQLExpiredCustomerEmailTokenErrorModel( + ); + } + + public static function of(): GraphQLExpiredCustomerEmailTokenErrorBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerEmailTokenErrorCollection.php b/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerEmailTokenErrorCollection.php new file mode 100644 index 00000000000..36280edf140 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerEmailTokenErrorCollection.php @@ -0,0 +1,56 @@ + + * @method GraphQLExpiredCustomerEmailTokenError current() + * @method GraphQLExpiredCustomerEmailTokenError end() + * @method GraphQLExpiredCustomerEmailTokenError at($offset) + */ +class GraphQLExpiredCustomerEmailTokenErrorCollection extends GraphQLErrorObjectCollection +{ + /** + * @psalm-assert GraphQLExpiredCustomerEmailTokenError $value + * @psalm-param GraphQLExpiredCustomerEmailTokenError|stdClass $value + * @throws InvalidArgumentException + * + * @return GraphQLExpiredCustomerEmailTokenErrorCollection + */ + public function add($value) + { + if (!$value instanceof GraphQLExpiredCustomerEmailTokenError) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?GraphQLExpiredCustomerEmailTokenError + */ + protected function mapper() + { + return function (?int $index): ?GraphQLExpiredCustomerEmailTokenError { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var GraphQLExpiredCustomerEmailTokenError $data */ + $data = GraphQLExpiredCustomerEmailTokenErrorModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerEmailTokenErrorModel.php b/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerEmailTokenErrorModel.php new file mode 100644 index 00000000000..2ad5c5d7d2e --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerEmailTokenErrorModel.php @@ -0,0 +1,71 @@ +code = $code ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getCode() + { + if (is_null($this->code)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CODE); + if (is_null($data)) { + return null; + } + $this->code = (string) $data; + } + + return $this->code; + } + + + + /** + * @return mixed + */ + public function by(string $key) + { + $data = $this->raw($key); + if (is_null($data)) { + return null; + } + + return $data; + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerPasswordTokenError.php b/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerPasswordTokenError.php new file mode 100644 index 00000000000..d20eda00568 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerPasswordTokenError.php @@ -0,0 +1,21 @@ + + */ +final class GraphQLExpiredCustomerPasswordTokenErrorBuilder implements Builder +{ + public function build(): GraphQLExpiredCustomerPasswordTokenError + { + return new GraphQLExpiredCustomerPasswordTokenErrorModel( + ); + } + + public static function of(): GraphQLExpiredCustomerPasswordTokenErrorBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerPasswordTokenErrorCollection.php b/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerPasswordTokenErrorCollection.php new file mode 100644 index 00000000000..34b143f73a0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerPasswordTokenErrorCollection.php @@ -0,0 +1,56 @@ + + * @method GraphQLExpiredCustomerPasswordTokenError current() + * @method GraphQLExpiredCustomerPasswordTokenError end() + * @method GraphQLExpiredCustomerPasswordTokenError at($offset) + */ +class GraphQLExpiredCustomerPasswordTokenErrorCollection extends GraphQLErrorObjectCollection +{ + /** + * @psalm-assert GraphQLExpiredCustomerPasswordTokenError $value + * @psalm-param GraphQLExpiredCustomerPasswordTokenError|stdClass $value + * @throws InvalidArgumentException + * + * @return GraphQLExpiredCustomerPasswordTokenErrorCollection + */ + public function add($value) + { + if (!$value instanceof GraphQLExpiredCustomerPasswordTokenError) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?GraphQLExpiredCustomerPasswordTokenError + */ + protected function mapper() + { + return function (?int $index): ?GraphQLExpiredCustomerPasswordTokenError { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var GraphQLExpiredCustomerPasswordTokenError $data */ + $data = GraphQLExpiredCustomerPasswordTokenErrorModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerPasswordTokenErrorModel.php b/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerPasswordTokenErrorModel.php new file mode 100644 index 00000000000..2e069cb2b1c --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLExpiredCustomerPasswordTokenErrorModel.php @@ -0,0 +1,71 @@ +code = $code ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getCode() + { + if (is_null($this->code)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CODE); + if (is_null($data)) { + return null; + } + $this->code = (string) $data; + } + + return $this->code; + } + + + + /** + * @return mixed + */ + public function by(string $key) + { + $data = $this->raw($key); + if (is_null($data)) { + return null; + } + + return $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessage.php index deee8fbd2e9..fdb54c6564a 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessage.php @@ -16,6 +16,8 @@ interface CustomerEmailTokenCreatedMessage extends Message { public const FIELD_CUSTOMER_ID = 'customerId'; public const FIELD_EXPIRES_AT = 'expiresAt'; + public const FIELD_VALUE = 'value'; + public const FIELD_INVALIDATE_OLDER_TOKENS = 'invalidateOlderTokens'; /** *

Unique identifier of the Customer.

@@ -33,6 +35,22 @@ public function getCustomerId(); */ public function getExpiresAt(); + /** + *

Value of the token, present only if the token's validity is 60 minutes or less.

+ * + + * @return null|string + */ + public function getValue(); + + /** + *

If true, all email tokens issued previously for the Customer are invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens(); + /** * @param ?string $customerId */ @@ -42,4 +60,14 @@ public function setCustomerId(?string $customerId): void; * @param ?DateTimeImmutable $expiresAt */ public function setExpiresAt(?DateTimeImmutable $expiresAt): void; + + /** + * @param ?string $value + */ + public function setValue(?string $value): void; + + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void; } diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessageBuilder.php index a9346bc6e58..77261c383d4 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessageBuilder.php @@ -99,6 +99,18 @@ final class CustomerEmailTokenCreatedMessageBuilder implements Builder */ private $expiresAt; + /** + + * @var ?string + */ + private $value; + + /** + + * @var ?bool + */ + private $invalidateOlderTokens; + /** *

Unique identifier of the Message. Can be used to track which Messages have been processed.

* @@ -232,6 +244,28 @@ public function getExpiresAt() return $this->expiresAt; } + /** + *

Value of the token, present only if the token's validity is 60 minutes or less.

+ * + + * @return null|string + */ + public function getValue() + { + return $this->value; + } + + /** + *

If true, all email tokens issued previously for the Customer are invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + return $this->invalidateOlderTokens; + } + /** * @param ?string $id * @return $this @@ -364,6 +398,28 @@ public function withExpiresAt(?DateTimeImmutable $expiresAt) return $this; } + /** + * @param ?string $value + * @return $this + */ + public function withValue(?string $value) + { + $this->value = $value; + + return $this; + } + + /** + * @param ?bool $invalidateOlderTokens + * @return $this + */ + public function withInvalidateOlderTokens(?bool $invalidateOlderTokens) + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -422,7 +478,9 @@ public function build(): CustomerEmailTokenCreatedMessage $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->customerId, - $this->expiresAt + $this->expiresAt, + $this->value, + $this->invalidateOlderTokens ); } diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessageModel.php index cc433647bdb..36d97a7e4d8 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessageModel.php @@ -105,6 +105,18 @@ final class CustomerEmailTokenCreatedMessageModel extends JsonObjectModel implem */ protected $expiresAt; + /** + * + * @var ?string + */ + protected $value; + + /** + * + * @var ?bool + */ + protected $invalidateOlderTokens; + /** * @psalm-suppress MissingParamType @@ -122,6 +134,8 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $customerId = null, ?DateTimeImmutable $expiresAt = null, + ?string $value = null, + ?bool $invalidateOlderTokens = null, ?string $type = null ) { $this->id = $id; @@ -136,6 +150,8 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->customerId = $customerId; $this->expiresAt = $expiresAt; + $this->value = $value; + $this->invalidateOlderTokens = $invalidateOlderTokens; $this->type = $type ?? self::DISCRIMINATOR_VALUE; } @@ -416,6 +432,46 @@ public function getExpiresAt() return $this->expiresAt; } + /** + *

Value of the token, present only if the token's validity is 60 minutes or less.

+ * + * + * @return null|string + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = (string) $data; + } + + return $this->value; + } + + /** + *

If true, all email tokens issued previously for the Customer are invalidated.

+ * + * + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + if (is_null($this->invalidateOlderTokens)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_INVALIDATE_OLDER_TOKENS); + if (is_null($data)) { + return null; + } + $this->invalidateOlderTokens = (bool) $data; + } + + return $this->invalidateOlderTokens; + } + /** * @param ?string $id @@ -513,6 +569,22 @@ public function setExpiresAt(?DateTimeImmutable $expiresAt): void $this->expiresAt = $expiresAt; } + /** + * @param ?string $value + */ + public function setValue(?string $value): void + { + $this->value = $value; + } + + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessagePayload.php index d6696d3d9e8..31848bcd16e 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessagePayload.php @@ -16,6 +16,8 @@ interface CustomerEmailTokenCreatedMessagePayload extends MessagePayload { public const FIELD_CUSTOMER_ID = 'customerId'; public const FIELD_EXPIRES_AT = 'expiresAt'; + public const FIELD_VALUE = 'value'; + public const FIELD_INVALIDATE_OLDER_TOKENS = 'invalidateOlderTokens'; /** *

Unique identifier of the Customer.

@@ -33,6 +35,22 @@ public function getCustomerId(); */ public function getExpiresAt(); + /** + *

Value of the token, present only if the token's validity is 60 minutes or less.

+ * + + * @return null|string + */ + public function getValue(); + + /** + *

If true, all email tokens issued previously for the Customer are invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens(); + /** * @param ?string $customerId */ @@ -42,4 +60,14 @@ public function setCustomerId(?string $customerId): void; * @param ?DateTimeImmutable $expiresAt */ public function setExpiresAt(?DateTimeImmutable $expiresAt): void; + + /** + * @param ?string $value + */ + public function setValue(?string $value): void; + + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void; } diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessagePayloadBuilder.php index 3f50fa93be6..d3d26991e7f 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessagePayloadBuilder.php @@ -33,6 +33,18 @@ final class CustomerEmailTokenCreatedMessagePayloadBuilder implements Builder */ private $expiresAt; + /** + + * @var ?string + */ + private $value; + + /** + + * @var ?bool + */ + private $invalidateOlderTokens; + /** *

Unique identifier of the Customer.

* @@ -55,6 +67,28 @@ public function getExpiresAt() return $this->expiresAt; } + /** + *

Value of the token, present only if the token's validity is 60 minutes or less.

+ * + + * @return null|string + */ + public function getValue() + { + return $this->value; + } + + /** + *

If true, all email tokens issued previously for the Customer are invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + return $this->invalidateOlderTokens; + } + /** * @param ?string $customerId * @return $this @@ -77,12 +111,36 @@ public function withExpiresAt(?DateTimeImmutable $expiresAt) return $this; } + /** + * @param ?string $value + * @return $this + */ + public function withValue(?string $value) + { + $this->value = $value; + + return $this; + } + + /** + * @param ?bool $invalidateOlderTokens + * @return $this + */ + public function withInvalidateOlderTokens(?bool $invalidateOlderTokens) + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + + return $this; + } + public function build(): CustomerEmailTokenCreatedMessagePayload { return new CustomerEmailTokenCreatedMessagePayloadModel( $this->customerId, - $this->expiresAt + $this->expiresAt, + $this->value, + $this->invalidateOlderTokens ); } diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessagePayloadModel.php index e246b9c41a8..e4ce374eaae 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailTokenCreatedMessagePayloadModel.php @@ -39,6 +39,18 @@ final class CustomerEmailTokenCreatedMessagePayloadModel extends JsonObjectModel */ protected $expiresAt; + /** + * + * @var ?string + */ + protected $value; + + /** + * + * @var ?bool + */ + protected $invalidateOlderTokens; + /** * @psalm-suppress MissingParamType @@ -46,10 +58,14 @@ final class CustomerEmailTokenCreatedMessagePayloadModel extends JsonObjectModel public function __construct( ?string $customerId = null, ?DateTimeImmutable $expiresAt = null, + ?string $value = null, + ?bool $invalidateOlderTokens = null, ?string $type = null ) { $this->customerId = $customerId; $this->expiresAt = $expiresAt; + $this->value = $value; + $this->invalidateOlderTokens = $invalidateOlderTokens; $this->type = $type ?? self::DISCRIMINATOR_VALUE; } @@ -115,6 +131,46 @@ public function getExpiresAt() return $this->expiresAt; } + /** + *

Value of the token, present only if the token's validity is 60 minutes or less.

+ * + * + * @return null|string + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = (string) $data; + } + + return $this->value; + } + + /** + *

If true, all email tokens issued previously for the Customer are invalidated.

+ * + * + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + if (is_null($this->invalidateOlderTokens)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_INVALIDATE_OLDER_TOKENS); + if (is_null($data)) { + return null; + } + $this->invalidateOlderTokens = (bool) $data; + } + + return $this->invalidateOlderTokens; + } + /** * @param ?string $customerId @@ -132,6 +188,22 @@ public function setExpiresAt(?DateTimeImmutable $expiresAt): void $this->expiresAt = $expiresAt; } + /** + * @param ?string $value + */ + public function setValue(?string $value): void + { + $this->value = $value; + } + + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessage.php index 42e7915d81e..00387ff0077 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessage.php @@ -16,6 +16,8 @@ interface CustomerPasswordTokenCreatedMessage extends Message { public const FIELD_CUSTOMER_ID = 'customerId'; public const FIELD_EXPIRES_AT = 'expiresAt'; + public const FIELD_VALUE = 'value'; + public const FIELD_INVALIDATE_OLDER_TOKENS = 'invalidateOlderTokens'; /** *

Unique identifier of the Customer.

@@ -33,6 +35,22 @@ public function getCustomerId(); */ public function getExpiresAt(); + /** + *

Value of the token, present only if the token's validity is 60 minutes or less.

+ * + + * @return null|string + */ + public function getValue(); + + /** + *

If true, all password tokens issued previously for the Customer are invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens(); + /** * @param ?string $customerId */ @@ -42,4 +60,14 @@ public function setCustomerId(?string $customerId): void; * @param ?DateTimeImmutable $expiresAt */ public function setExpiresAt(?DateTimeImmutable $expiresAt): void; + + /** + * @param ?string $value + */ + public function setValue(?string $value): void; + + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void; } diff --git a/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessageBuilder.php index a26cdb82910..33284834fed 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessageBuilder.php @@ -99,6 +99,18 @@ final class CustomerPasswordTokenCreatedMessageBuilder implements Builder */ private $expiresAt; + /** + + * @var ?string + */ + private $value; + + /** + + * @var ?bool + */ + private $invalidateOlderTokens; + /** *

Unique identifier of the Message. Can be used to track which Messages have been processed.

* @@ -232,6 +244,28 @@ public function getExpiresAt() return $this->expiresAt; } + /** + *

Value of the token, present only if the token's validity is 60 minutes or less.

+ * + + * @return null|string + */ + public function getValue() + { + return $this->value; + } + + /** + *

If true, all password tokens issued previously for the Customer are invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + return $this->invalidateOlderTokens; + } + /** * @param ?string $id * @return $this @@ -364,6 +398,28 @@ public function withExpiresAt(?DateTimeImmutable $expiresAt) return $this; } + /** + * @param ?string $value + * @return $this + */ + public function withValue(?string $value) + { + $this->value = $value; + + return $this; + } + + /** + * @param ?bool $invalidateOlderTokens + * @return $this + */ + public function withInvalidateOlderTokens(?bool $invalidateOlderTokens) + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -422,7 +478,9 @@ public function build(): CustomerPasswordTokenCreatedMessage $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->customerId, - $this->expiresAt + $this->expiresAt, + $this->value, + $this->invalidateOlderTokens ); } diff --git a/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessageModel.php index 896aa1b7b00..0b987036eae 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessageModel.php @@ -105,6 +105,18 @@ final class CustomerPasswordTokenCreatedMessageModel extends JsonObjectModel imp */ protected $expiresAt; + /** + * + * @var ?string + */ + protected $value; + + /** + * + * @var ?bool + */ + protected $invalidateOlderTokens; + /** * @psalm-suppress MissingParamType @@ -122,6 +134,8 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $customerId = null, ?DateTimeImmutable $expiresAt = null, + ?string $value = null, + ?bool $invalidateOlderTokens = null, ?string $type = null ) { $this->id = $id; @@ -136,6 +150,8 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->customerId = $customerId; $this->expiresAt = $expiresAt; + $this->value = $value; + $this->invalidateOlderTokens = $invalidateOlderTokens; $this->type = $type ?? self::DISCRIMINATOR_VALUE; } @@ -416,6 +432,46 @@ public function getExpiresAt() return $this->expiresAt; } + /** + *

Value of the token, present only if the token's validity is 60 minutes or less.

+ * + * + * @return null|string + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = (string) $data; + } + + return $this->value; + } + + /** + *

If true, all password tokens issued previously for the Customer are invalidated.

+ * + * + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + if (is_null($this->invalidateOlderTokens)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_INVALIDATE_OLDER_TOKENS); + if (is_null($data)) { + return null; + } + $this->invalidateOlderTokens = (bool) $data; + } + + return $this->invalidateOlderTokens; + } + /** * @param ?string $id @@ -513,6 +569,22 @@ public function setExpiresAt(?DateTimeImmutable $expiresAt): void $this->expiresAt = $expiresAt; } + /** + * @param ?string $value + */ + public function setValue(?string $value): void + { + $this->value = $value; + } + + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessagePayload.php index 34fbcf2979c..69d3f35e69a 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessagePayload.php @@ -16,6 +16,8 @@ interface CustomerPasswordTokenCreatedMessagePayload extends MessagePayload { public const FIELD_CUSTOMER_ID = 'customerId'; public const FIELD_EXPIRES_AT = 'expiresAt'; + public const FIELD_VALUE = 'value'; + public const FIELD_INVALIDATE_OLDER_TOKENS = 'invalidateOlderTokens'; /** *

Unique identifier of the Customer.

@@ -33,6 +35,22 @@ public function getCustomerId(); */ public function getExpiresAt(); + /** + *

Value of the token, present only if the token's validity is 60 minutes or less.

+ * + + * @return null|string + */ + public function getValue(); + + /** + *

If true, all password tokens issued previously for the Customer are invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens(); + /** * @param ?string $customerId */ @@ -42,4 +60,14 @@ public function setCustomerId(?string $customerId): void; * @param ?DateTimeImmutable $expiresAt */ public function setExpiresAt(?DateTimeImmutable $expiresAt): void; + + /** + * @param ?string $value + */ + public function setValue(?string $value): void; + + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void; } diff --git a/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessagePayloadBuilder.php index 001ce1e8453..8151d49c232 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessagePayloadBuilder.php @@ -33,6 +33,18 @@ final class CustomerPasswordTokenCreatedMessagePayloadBuilder implements Builder */ private $expiresAt; + /** + + * @var ?string + */ + private $value; + + /** + + * @var ?bool + */ + private $invalidateOlderTokens; + /** *

Unique identifier of the Customer.

* @@ -55,6 +67,28 @@ public function getExpiresAt() return $this->expiresAt; } + /** + *

Value of the token, present only if the token's validity is 60 minutes or less.

+ * + + * @return null|string + */ + public function getValue() + { + return $this->value; + } + + /** + *

If true, all password tokens issued previously for the Customer are invalidated.

+ * + + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + return $this->invalidateOlderTokens; + } + /** * @param ?string $customerId * @return $this @@ -77,12 +111,36 @@ public function withExpiresAt(?DateTimeImmutable $expiresAt) return $this; } + /** + * @param ?string $value + * @return $this + */ + public function withValue(?string $value) + { + $this->value = $value; + + return $this; + } + + /** + * @param ?bool $invalidateOlderTokens + * @return $this + */ + public function withInvalidateOlderTokens(?bool $invalidateOlderTokens) + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + + return $this; + } + public function build(): CustomerPasswordTokenCreatedMessagePayload { return new CustomerPasswordTokenCreatedMessagePayloadModel( $this->customerId, - $this->expiresAt + $this->expiresAt, + $this->value, + $this->invalidateOlderTokens ); } diff --git a/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessagePayloadModel.php index 484a13dc804..99f09fc1784 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerPasswordTokenCreatedMessagePayloadModel.php @@ -39,6 +39,18 @@ final class CustomerPasswordTokenCreatedMessagePayloadModel extends JsonObjectMo */ protected $expiresAt; + /** + * + * @var ?string + */ + protected $value; + + /** + * + * @var ?bool + */ + protected $invalidateOlderTokens; + /** * @psalm-suppress MissingParamType @@ -46,10 +58,14 @@ final class CustomerPasswordTokenCreatedMessagePayloadModel extends JsonObjectMo public function __construct( ?string $customerId = null, ?DateTimeImmutable $expiresAt = null, + ?string $value = null, + ?bool $invalidateOlderTokens = null, ?string $type = null ) { $this->customerId = $customerId; $this->expiresAt = $expiresAt; + $this->value = $value; + $this->invalidateOlderTokens = $invalidateOlderTokens; $this->type = $type ?? self::DISCRIMINATOR_VALUE; } @@ -115,6 +131,46 @@ public function getExpiresAt() return $this->expiresAt; } + /** + *

Value of the token, present only if the token's validity is 60 minutes or less.

+ * + * + * @return null|string + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = (string) $data; + } + + return $this->value; + } + + /** + *

If true, all password tokens issued previously for the Customer are invalidated.

+ * + * + * @return null|bool + */ + public function getInvalidateOlderTokens() + { + if (is_null($this->invalidateOlderTokens)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_INVALIDATE_OLDER_TOKENS); + if (is_null($data)) { + return null; + } + $this->invalidateOlderTokens = (bool) $data; + } + + return $this->invalidateOlderTokens; + } + /** * @param ?string $customerId @@ -132,6 +188,22 @@ public function setExpiresAt(?DateTimeImmutable $expiresAt): void $this->expiresAt = $expiresAt; } + /** + * @param ?string $value + */ + public function setValue(?string $value): void + { + $this->value = $value; + } + + /** + * @param ?bool $invalidateOlderTokens + */ + public function setInvalidateOlderTokens(?bool $invalidateOlderTokens): void + { + $this->invalidateOlderTokens = $invalidateOlderTokens; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/references.txt b/references.txt index 0ad3129253d..574fa273edb 100644 --- a/references.txt +++ b/references.txt @@ -418,3 +418,4 @@ ab2859c84d9f146e5d8556e905538b92af4aa044 5f7c0bef26fa70b6a3ec382455b56146e3088e0e 7c59b29681399c1a3000934fd59a46c10cbe5401 dd595db3882a9eef83a47515f013be37deae6bff +10b807d404cfeba225736763251d8ba6d8b16db3