|
|
@@ -31,8 +31,8 @@ class CustomerService {
|
|
|
refreshVerificationToken(ctx: RequestContext, emailAddress: string) => Promise<void>;
|
|
|
verifyCustomerEmailAddress(ctx: RequestContext, verificationToken: string, password?: string) => Promise<ErrorResultUnion<VerifyCustomerAccountResult, Customer>>;
|
|
|
requestPasswordReset(ctx: RequestContext, emailAddress: string) => Promise<void>;
|
|
|
- resetPassword(ctx: RequestContext, passwordResetToken: string, password: string) => Promise<
|
|
|
- User | PasswordResetTokenExpiredError | PasswordResetTokenInvalidError | PasswordValidationError
|
|
|
+ resetPassword(ctx: RequestContext, passwordResetToken: string, password: string) => Promise<
|
|
|
+ User | PasswordResetTokenExpiredError | PasswordResetTokenInvalidError | PasswordValidationError
|
|
|
>;
|
|
|
requestUpdateEmailAddress(ctx: RequestContext, userId: ID, newEmailAddress: string) => Promise<boolean | EmailAddressConflictError>;
|
|
|
updateEmailAddress(ctx: RequestContext, token: string) => Promise<boolean | IdentifierChangeTokenInvalidError | IdentifierChangeTokenExpiredError>;
|
|
|
@@ -69,8 +69,8 @@ class CustomerService {
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, userId: <a href='/reference/typescript-api/common/id#id'>ID</a>, filterOnChannel: = true) => Promise<<a href='/reference/typescript-api/entities/customer#customer'>Customer</a> | undefined>`} />
|
|
|
|
|
|
-Returns the Customer entity associated with the given userId, if one exists.
|
|
|
-Setting `filterOnChannel` to `true` will limit the results to Customers which are assigned
|
|
|
+Returns the Customer entity associated with the given userId, if one exists.
|
|
|
+Setting `filterOnChannel` to `true` will limit the results to Customers which are assigned
|
|
|
to the current active Channel only.
|
|
|
### findAddressesByCustomerId
|
|
|
|
|
|
@@ -86,13 +86,13 @@ Returns a list of all <a href='/reference/typescript-api/entities/customer-group
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, input: CreateCustomerInput, password?: string) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><CreateCustomerResult, <a href='/reference/typescript-api/entities/customer#customer'>Customer</a>>>`} />
|
|
|
|
|
|
-Creates a new Customer, including creation of a new User with the special `customer` Role.
|
|
|
-
|
|
|
-If the `password` argument is specified, the Customer will be immediately verified. If not,
|
|
|
-then an <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a> is published, so that the customer can have their
|
|
|
-email address verified and set their password in a later step using the `verifyCustomerEmailAddress()`
|
|
|
-method.
|
|
|
-
|
|
|
+Creates a new Customer, including creation of a new User with the special `customer` Role.
|
|
|
+
|
|
|
+If the `password` argument is specified, the Customer will be immediately verified. If not,
|
|
|
+then an <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a> is published, so that the customer can have their
|
|
|
+email address verified and set their password in a later step using the `verifyCustomerEmailAddress()`
|
|
|
+method.
|
|
|
+
|
|
|
This method is intended to be used in admin-created Customer flows.
|
|
|
### update
|
|
|
|
|
|
@@ -113,47 +113,47 @@ This method is intended to be used in admin-created Customer flows.
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, input: RegisterCustomerInput) => Promise<RegisterCustomerAccountResult | EmailAddressConflictError | PasswordValidationError>`} />
|
|
|
|
|
|
-Registers a new Customer account with the <a href='/reference/typescript-api/auth/native-authentication-strategy#nativeauthenticationstrategy'>NativeAuthenticationStrategy</a> and starts
|
|
|
-the email verification flow (unless <a href='/reference/typescript-api/auth/auth-options#authoptions'>AuthOptions</a> `requireVerification` is set to `false`)
|
|
|
-by publishing an <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a>.
|
|
|
-
|
|
|
+Registers a new Customer account with the <a href='/reference/typescript-api/auth/native-authentication-strategy#nativeauthenticationstrategy'>NativeAuthenticationStrategy</a> and starts
|
|
|
+the email verification flow (unless <a href='/reference/typescript-api/auth/auth-options#authoptions'>AuthOptions</a> `requireVerification` is set to `false`)
|
|
|
+by publishing an <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a>.
|
|
|
+
|
|
|
This method is intended to be used in storefront Customer-creation flows.
|
|
|
### refreshVerificationToken
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, emailAddress: string) => Promise<void>`} />
|
|
|
|
|
|
-Refreshes a stale email address verification token by generating a new one and
|
|
|
+Refreshes a stale email address verification token by generating a new one and
|
|
|
publishing a <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a>.
|
|
|
### verifyCustomerEmailAddress
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, verificationToken: string, password?: string) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><VerifyCustomerAccountResult, <a href='/reference/typescript-api/entities/customer#customer'>Customer</a>>>`} />
|
|
|
|
|
|
-Given a valid verification token which has been published in an <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a>, this
|
|
|
+Given a valid verification token which has been published in an <a href='/reference/typescript-api/events/event-types#accountregistrationevent'>AccountRegistrationEvent</a>, this
|
|
|
method is used to set the Customer as `verified` as part of the account registration flow.
|
|
|
### requestPasswordReset
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, emailAddress: string) => Promise<void>`} />
|
|
|
|
|
|
-Publishes a new <a href='/reference/typescript-api/events/event-types#passwordresetevent'>PasswordResetEvent</a> for the given email address. This event creates
|
|
|
+Publishes a new <a href='/reference/typescript-api/events/event-types#passwordresetevent'>PasswordResetEvent</a> for the given email address. This event creates
|
|
|
a token which can be used in the `resetPassword()` method.
|
|
|
### resetPassword
|
|
|
|
|
|
-<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, passwordResetToken: string, password: string) => Promise< <a href='/reference/typescript-api/entities/user#user'>User</a> | PasswordResetTokenExpiredError | PasswordResetTokenInvalidError | PasswordValidationError >`} />
|
|
|
+<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, passwordResetToken: string, password: string) => Promise<
<a href='/reference/typescript-api/entities/user#user'>User</a> | PasswordResetTokenExpiredError | PasswordResetTokenInvalidError | PasswordValidationError
>`} />
|
|
|
|
|
|
-Given a valid password reset token created by a call to the `requestPasswordReset()` method,
|
|
|
+Given a valid password reset token created by a call to the `requestPasswordReset()` method,
|
|
|
this method will change the Customer's password to that given as the `password` argument.
|
|
|
### requestUpdateEmailAddress
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, userId: <a href='/reference/typescript-api/common/id#id'>ID</a>, newEmailAddress: string) => Promise<boolean | EmailAddressConflictError>`} />
|
|
|
|
|
|
-Publishes a <a href='/reference/typescript-api/events/event-types#identifierchangerequestevent'>IdentifierChangeRequestEvent</a> for the given User. This event contains a token
|
|
|
-which is then used in the `updateEmailAddress()` method to change the email address of the User &
|
|
|
+Publishes a <a href='/reference/typescript-api/events/event-types#identifierchangerequestevent'>IdentifierChangeRequestEvent</a> for the given User. This event contains a token
|
|
|
+which is then used in the `updateEmailAddress()` method to change the email address of the User &
|
|
|
Customer.
|
|
|
### updateEmailAddress
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, token: string) => Promise<boolean | IdentifierChangeTokenInvalidError | IdentifierChangeTokenExpiredError>`} />
|
|
|
|
|
|
-Given a valid email update token published in a <a href='/reference/typescript-api/events/event-types#identifierchangerequestevent'>IdentifierChangeRequestEvent</a>, this method
|
|
|
+Given a valid email update token published in a <a href='/reference/typescript-api/events/event-types#identifierchangerequestevent'>IdentifierChangeRequestEvent</a>, this method
|
|
|
will update the Customer & User email address.
|
|
|
### createOrUpdate
|
|
|
|
|
|
@@ -184,8 +184,8 @@ Creates a new <a href='/reference/typescript-api/entities/address#address'>Addre
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, order: <a href='/reference/typescript-api/entities/order#order'>Order</a>) => `} />
|
|
|
|
|
|
-If the Customer associated with the given Order does not yet have any Addresses,
|
|
|
-this method will create new Address(es) based on the Order's shipping & billing
|
|
|
+If the Customer associated with the given Order does not yet have any Addresses,
|
|
|
+this method will create new Address(es) based on the Order's shipping & billing
|
|
|
addresses.
|
|
|
### addNoteToCustomer
|
|
|
|