Application Load

IStorefrontProfileAction

The physical TypeScript declaration from the Nuxt starter, with linked types and field comments.

IStorefrontProfileAction

Discriminated account action emitted by a profile form.

src/lib/interfaces/orionplace/accounts/IStorefrontProfile.ts
TypeScript
export type IStorefrontProfileAction =
  | {
      // Value of action.
      action:
        'load' | 'refresh' | 'avatar-delete' | 'auth-resend' | 'auth-restart';
    }
  | { /* Value of action. */ action: 'details'; /* Value of data. */ data: IProfileUpdateRequest }
  | { /* Value of action. */ action: 'password'; /* Value of data. */ data: IProfilePasswordRequest }
  | { /* Value of action. */ action: 'delete-account'; /* Value of data. */ data: IProfileDeleteRequest }
  | { /* Value of action. */ action: 'avatar-add'; /* Value of file. */ file: File }
  | {
      // Value of action.
      action: 'email';
      // Value of data.
      data:
        | { /* Value of step. */ step: 'step_email'; /* Value of email. */ email: string }
        | { /* Value of step. */ step: 'step_email_code'; /* Value of code. */ code: string };
    }
  | { /* Value of action. */ action: 'notifications'; /* Value of data. */ data: { /* For the `notifications` action, `true` enables all optional email notification types and `false` disables them. Enabling requires a saved email address. */ enabled: boolean } }
  | {
      // Value of action.
      action: 'notification-locale';
      // Value of data.
      data: { /* Value of email_notification_locale. */ email_notification_locale: string };
    }
  | {
      // Value of action.
      action: 'authenticate';
      // Value of data.
      data: {
        // Value of step.
        step: IStorefrontProfileState['authStep'];
        // Optional value of phone; it may be omitted.
        phone?: string;
        // Optional value of auth_password; it may be omitted.
        auth_password?: string;
        // Optional value of otp_code; it may be omitted.
        otp_code?: string;
        // Optional value of first_name; it may be omitted.
        first_name?: string;
        // Optional value of last_name; it may be omitted.
        last_name?: string;
      };
    };