ShopCollaborator

db · /index·interface

Canonical join row relating a shop to one collaborating user. De-embedded from the prior shape that nested the full UserBase document inside the array: a collaborator now references its user by id string (user) — the same id-ref pattern ReviewBase['shop'] adopted in the shop==tenant collapse — paired with the permissions granted on this shop. The shop side of the relation is the parent document, so a row carries only the user-side id plus its permissions and never embeds a user document (so it can leak no user fields). This is the canonical join shape the Convex shopCollaborators table stores keyed by { shop, user }.

Properties

permissions
string[]
user
string

Example

import type { ShopCollaborator } from '@nordcom/commerce-db';
function collaboratorIds(collaborators: ShopCollaborator[]): string[] {
    return collaborators.map((c) => c.user);
}

FeatureFlagService ReviewService ShopService FeatureFlagOption FeatureFlagRef ResolvedCartLineTokens ResolvedProductCardTokens ResolvedShopTheme

Sourceshop.ts:120Edit the JSDoc directly
Metadata@nordcom/commerce-db@0.1.0Open in GitHub ↗

On this page