Ecommerce

Canonical Actions

Actions available for implementation and usage

Canonical actions can be imported from the @laioutr-core/canonical-types package. They represent actions that are common in an ecommerce application and may have different implementations depending on the app.

These can be imported from the @laioutr-core/canonical-types/ecommerce package. They bundle all the actions for the ecommerce domain.

Auth

AuthLoginAction ecommerce/auth/login

Input

email
string required
The email address of the user.
password
string required
The password of the user.

Output

success
boolean required
message
string

AuthLogoutAction ecommerce/auth/logout

Input

customerAccessToken
string required

Output

AuthRegisterAction ecommerce/auth/register

Input

email
string required
The email address of the user.
password
string required
The password of the user.
firstName
__schema0 required
lastName
__schema1 required
salutation
__schema2
title
__schema3
address
MailingAddress required

Output

AuthRecoverAction ecommerce/auth/recover

Input

email
string required

Output

Cart

CartAddItemsAction ecommerce/cart/add-items

Input

array

Output

CartRemoveItemsAction ecommerce/cart/remove-items

Input

arraystring

Output

CartUpdateItemsAction ecommerce/cart/update-items

Input

array
itemId
string required
Cart line-item id.
quantity
number
The new quantity of the item. Won't update if undefined. Only works for products.
customFields
object

Output

Wishlist

WishlistAddItemsAction ecommerce/wishlist/add-items

Input

array
productId
string required
The product id.
variantId
string
The variant id.
customFields
object

Output

WishlistRemoveItemsAction ecommerce/wishlist/remove-items

Input

arraystring

Output

Customer

CustomerAddressGetAllAction ecommerce/customer/address-get-all

Input

Output

addresses
MailingAddress[] required

CustomerAddressCreateAction ecommerce/customer/address-create

Input

address
MailingAddress required

Output

CustomerAddressUpdateAction ecommerce/customer/address-update

Input

id
string required
The ID of the address to update.
address
object required

Output

CustomerAddressDeleteAction ecommerce/customer/address-delete

Input

id
string required
The ID of the address to delete.

Output

CustomerAddressSetDefaultAction ecommerce/customer/address-set-default

Input

id
string required
The ID of the address to set as default.
type
"shipping" | "billing" required
The type of default to set. Not all backends may support this distinction.

Output

import { AuthLoginAction, AuthLogoutAction, AuthRecoverAction, CartAddItemsAction, WishlistAddItemsAction } from '@laioutr-core/canonical-types/ecommerce';
import type { ActionToken, ActionTokenMetadataOf, ActionTokenInputOf, ActionTokenOutputOf } from '@laioutr-core/core-types/orchestr';
type ActionInfo<TAction extends ActionToken> = {
    name: ActionTokenMetadataOf<TAction>['name'];
    input: ActionTokenInputOf<TAction>;
    output: ActionTokenOutputOf<TAction>;
};
// ---cut---
type AuthLoginActionInfo = ActionInfo<typeof AuthLoginAction>;
type AuthLogoutActionInfo = ActionInfo<typeof AuthLogoutAction>;
type AuthRecoverActionInfo = ActionInfo<typeof AuthRecoverAction>;
type CartAddItemsActionInfo = ActionInfo<typeof CartAddItemsAction>;
type WishlistAddItemsActionInfo = ActionInfo<typeof WishlistAddItemsAction>;