OnlineShop
Client-safe shop shape returned by all ShopService read methods; safe to pass to Client
Components or server actions. Historically this stripped the hydrated Mongoose document methods
off ShopBase; the Convex-backed seam returns plain rows, so the only remaining difference is
that collaborators becomes optional. Credential fields (authentication.token,
customers.clientSecret) live in the split-out Convex shopCredentials table and are only
attached when sensitiveData: true is passed to ShopService.findByDomain.
Definition
type OnlineShop = Omit<ShopBase, 'collaborators'> & { collaborators: ShopBase['collaborators'] };Omit<ShopBase, 'collaborators'> & { collaborators: ShopBase['collaborators'] }
Example
import type { OnlineShop } from '@nordcom/commerce-db';
function shopDomain(shop: OnlineShop): string {
return shop.domain;
}Related
FeatureFlagService ReviewService ShopService FeatureFlagOption FeatureFlagRef ResolvedCartLineTokens ResolvedProductCardTokens ResolvedShopTheme
Nullable
Adds null to a type to represent an explicitly absent value, distinct from undefined which TypeScript uses for optional properties. Use when a field can be clea
Optional
Converts every key of T to optional and nullable. Use to type partial update inputs where any field may be omitted or explicitly cleared to null.