Saxonberg Server API
    Preparing search index...

    Provider contract. Concrete providers in lib/social/providers/.

    members is the canonical read; roleOf is the canonical role projection. isMember and onChange are optional fast-path / live-notification seams (defaults derive from roleOf and no-op respectively).

    Role projection is mandatory. Every provider projects its native concept into the coarse 'owner' | 'admin' | 'member' vocabulary as best it can — even when the underlying source has no native role hierarchy (mql, contacts), the projection is "everyone in the materialized set is 'member'". Surfacing null is the "not in the group at all" signal. Sources with richer hierarchies (a future guild provider with leader / officer / member) fold their native roles into the coarse vocabulary — the contract is intentionally lossy.

    Writable providers add add / remove / setRole / create / destroy on top — the managed provider has them; mql / contacts don't.

    interface GroupProvider {
        source: string;
        isMember?(playerId: string, id: string): Promise<boolean>;
        members(id: string): Promise<Stuff[]>;
        onChange?(id: string, cb: GroupChangeListener): GroupChangeHandle;
        roleOf(playerId: string, id: string): Promise<GroupRole | null>;
    }

    Implemented by

    Index

    Properties

    source: string

    First colon-prefix of the GroupRef this provider handles.

    Methods

    • Project the source's native role for playerId in group id into the coarse GroupRole vocabulary. null = not in the group. Sources without a native role concept return 'member' for any matched entry.

      Parameters

      • playerId: string
      • id: string

      Returns Promise<GroupRole | null>