Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .changeset/changes_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<details>
<summary>Added Type(s)</summary>

- added type `ExpiredCustomerEmailTokenError`
- added type `ExpiredCustomerPasswordTokenError`
- added type `GraphQLExpiredCustomerEmailTokenError`
- added type `GraphQLExpiredCustomerPasswordTokenError`
- added type `CheckoutOrderCreationFailedEvent`
- added type `CheckoutPaymentAuthorizationCancelledEvent`
- added type `CheckoutPaymentAuthorizationFailedEvent`
Expand All @@ -20,6 +24,22 @@
- added type `CheckoutMessagePaymentsPayloadBaseData`
</details>

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

- added property `invalidateOlderTokens` to type `CustomerCreateEmailToken`
- added property `invalidateOlderTokens` to type `CustomerCreatePasswordResetToken`
- 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`
</details>

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

Expand Down
20 changes: 20 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
<details>
<summary>Added Type(s)</summary>

- added type `ExpiredCustomerEmailTokenError`
- added type `ExpiredCustomerPasswordTokenError`
- added type `GraphQLExpiredCustomerEmailTokenError`
- added type `GraphQLExpiredCustomerPasswordTokenError`
- added type `CheckoutOrderCreationFailedEvent`
- added type `CheckoutPaymentAuthorizationCancelledEvent`
- added type `CheckoutPaymentAuthorizationFailedEvent`
Expand All @@ -16,6 +20,22 @@
- added type `CheckoutMessagePaymentsPayloadBaseData`
</details>

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

- added property `invalidateOlderTokens` to type `CustomerCreateEmailToken`
- added property `invalidateOlderTokens` to type `CustomerCreatePasswordResetToken`
- 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`
</details>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export class ByProjectKeyCustomersEmailConfirmRequestBuilder {
*
* 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).
*
*/
public post(methodArgs: {
body: CustomerEmailVerify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export class ByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmRequestBuilder
*
* 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).
*
*/
public post(methodArgs: {
body: CustomerEmailVerify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export class ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmRequestBuilder {
/**
* 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export class ByProjectKeyMeEmailConfirmRequestBuilder {
/**
* 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).
*
*/
public post(methodArgs: {
body: MyCustomerEmailVerify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class ByProjectKeyCustomersEmailTokenRequestBuilder {
* 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.
*
*/
public post(methodArgs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export class ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenRequestBuilder {
*
* 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.
*
*/
public post(methodArgs: {
body: CustomerCreateEmailToken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export class ByProjectKeyCustomersPasswordTokenRequestBuilder {
/**
* 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.
*
*/
public post(methodArgs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ export class ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenRequestBuilde
/**
* 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.
*
*/
public post(methodArgs: {
body: CustomerCreatePasswordResetToken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export class ByProjectKeyCustomersPasswordResetRequestBuilder {
/**
* 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).
*
*/
public post(methodArgs: {
body: CustomerResetPassword
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export class ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetRequestBuilde
/**
* 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.
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export class ByProjectKeyInStoreKeyByStoreKeyMePasswordResetRequestBuilder {
*
* 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export class ByProjectKeyMePasswordResetRequestBuilder {
*
* 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).
*
*/
public post(methodArgs: {
body: MyCustomerResetPassword
Expand Down
18 changes: 18 additions & 0 deletions packages/platform-sdk/src/generated/models/customer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ export interface CustomerCreateEmailToken {
*
*/
readonly ttlMinutes: number
/**
* If set to `true`, all email tokens issued previously for the Customer will be invalidated.
*
*
*/
readonly invalidateOlderTokens?: boolean
}
export interface CustomerCreatePasswordResetToken {
/**
Expand All @@ -298,6 +304,12 @@ export interface CustomerCreatePasswordResetToken {
*
*/
readonly ttlMinutes?: number
/**
* If set to `true`, all password tokens issued previously for the Customer will be invalidated.
*
*
*/
readonly invalidateOlderTokens?: boolean
}
export interface CustomerDraft {
/**
Expand Down Expand Up @@ -729,6 +741,12 @@ export interface CustomerToken {
*
*/
readonly expiresAt: string
/**
* If `true`, all tokens issued previously for the Customer will be invalidated.
*
*
*/
readonly invalidateOlderTokens: boolean
/**
* Date and time (UTC) the token was initially created.
*
Expand Down
70 changes: 70 additions & 0 deletions packages/platform-sdk/src/generated/models/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export type ErrorObject =
| EnumKeyDoesNotExistError
| EnumValueIsUsedError
| EnumValuesMustMatchError
| ExpiredCustomerEmailTokenError
| ExpiredCustomerPasswordTokenError
| ExtensionBadResponseError
| ExtensionNoResponseError
| ExtensionPredicateEvaluationFailedError
Expand Down Expand Up @@ -838,6 +840,44 @@ export interface AuthErrorResponse extends ErrorResponse {
*/
readonly errors: ErrorObject[]
}
/**
* Returned when the provided email token of the Customer has expired.
*
* The error is returned as a failed response to:
*
* - [Get Customer by email token](ctp:api:endpoint:/{projectKey}/customers/email-token={emailToken}:GET) and [Get Customer in Store by email token](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/customers/email-token={emailToken}:GET) requests
* - [Verify email of Customer](ctp:api:endpoint:/{projectKey}/customers/email/confirm:POST) and [Verify email of Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/customers/email/confirm:POST) requests
*
*/
export interface ExpiredCustomerEmailTokenError extends IErrorObject {
readonly code: 'ExpiredCustomerEmailToken'
[key: string]: any
/**
* `"The given email token has expired."`
*
*
*/
readonly message: string
}
/**
* Returned when the provided password token of the Customer has expired.
*
* The error is returned as a failed response to:
*
* - [Get Customer by password token](ctp:api:endpoint:/{projectKey}/customers/password-token={passwordToken}:GET) and [Get Customer in Store by password token](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/customers/password-token={passwordToken}:GET) requests
* - [Reset password of Customer](ctp:api:endpoint:/{projectKey}/customers/password/reset:POST) and [Reset password of Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/customers/password/reset:POST) requests
*
*/
export interface ExpiredCustomerPasswordTokenError extends IErrorObject {
readonly code: 'ExpiredCustomerPasswordToken'
[key: string]: any
/**
* `"The given password token has expired."`
*
*
*/
readonly message: string
}
/**
* Returned when the response from the API Extension could not be parsed successfully (such as a `500` HTTP status code, or an invalid JSON response).
*
Expand Down Expand Up @@ -2102,6 +2142,8 @@ export type GraphQLErrorObject =
| GraphQLEnumKeyDoesNotExistError
| GraphQLEnumValueIsUsedError
| GraphQLEnumValuesMustMatchError
| GraphQLExpiredCustomerEmailTokenError
| GraphQLExpiredCustomerPasswordTokenError
| GraphQLExtensionBadResponseError
| GraphQLExtensionNoResponseError
| GraphQLExtensionPredicateEvaluationFailedError
Expand Down Expand Up @@ -2678,6 +2720,34 @@ export interface GraphQLEnumValuesMustMatchError extends IGraphQLErrorObject {
readonly code: 'EnumValuesMustMatch'
[key: string]: any
}
/**
* Returned when the provided email token of the Customer has expired.
*
* The error is returned as a failed response to:
*
* - [Get Customer by email token](ctp:api:endpoint:/{projectKey}/customers/email-token={emailToken}:GET) and [Get Customer in Store by email token](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/customers/email-token={emailToken}:GET) requests
* - [Verify email of Customer](ctp:api:endpoint:/{projectKey}/customers/email/confirm:POST) and [Verify email of Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/customers/email/confirm:POST) requests
*
*/
export interface GraphQLExpiredCustomerEmailTokenError
extends IGraphQLErrorObject {
readonly code: 'ExpiredCustomerEmailToken'
[key: string]: any
}
/**
* Returned when the provided password token of the Customer has expired.
*
* The error is returned as a failed response to:
*
* - [Get Customer by password token](ctp:api:endpoint:/{projectKey}/customers/password-token={passwordToken}:GET) and [Get Customer in Store by password token](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/customers/password-token={passwordToken}:GET) requests
* - [Reset password of Customer](ctp:api:endpoint:/{projectKey}/customers/password/reset:POST) and [Reset password of Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/customers/password/reset:POST) requests
*
*/
export interface GraphQLExpiredCustomerPasswordTokenError
extends IGraphQLErrorObject {
readonly code: 'ExpiredCustomerPasswordToken'
[key: string]: any
}
/**
* Returned when the response from the API Extension could not be parsed successfully (such as a `500` HTTP status code, or an invalid JSON response).
*
Expand Down
Loading