Sporades SDK API
    Preparing search index...

    Type Alias CurrentUserTeamsApi

    type CurrentUserTeamsApi = {
        create(name: string): Promise<{ team: TeamSummary }>;
        createJoinLink(
            teamId: string,
            email: string,
            options?: { ttlSeconds?: number },
        ): Promise<
            { createdAt: string; expiresAt: string; id: string; link: string },
        >;
        delete(teamId: string): Promise<{ deleted: true }>;
        demote(teamId: string, userId: string): Promise<{ updated: true }>;
        inspectJoinLink(code: string): Promise<TeamJoinLinkInspection>;
        join(code: string): Promise<{ team: TeamSummary }>;
        leave(teamId: string): Promise<{ left: true }>;
        list(): Promise<{ teams: TeamSummary[] }>;
        listJoinLinks(teamId: string): Promise<{ links: TeamJoinLink[] }>;
        listMembers(teamId: string): Promise<{ members: TeamMemberSummary[] }>;
        promote(teamId: string, userId: string): Promise<{ updated: true }>;
        removeMember(teamId: string, userId: string): Promise<{ removed: true }>;
        rename(teamId: string, name: string): Promise<{ team: TeamSummary }>;
        revokeJoinLink(
            teamId: string,
            joinLinkId: string,
        ): Promise<{ revoked: true }>;
        updateApplicationRoles(
            teamId: string,
            userId: string,
            changes: TeamApplicationRoleChanges,
        ): Promise<{ updated: true }>;
        validateJoinLink(code: string): Promise<TeamJoinLinkValidation>;
    }
    Index
    • Creates a named Team and makes the current linked user its first admin. Linked users may belong to at most 25 Teams.

      Parameters

      • name: string

      Returns Promise<{ team: TeamSummary }>

    • Creates an email-bound Join link and returns it without sending any message. The default lifetime is 86400 seconds; accepted integer lifetimes are 300 through 604800 seconds.

      Parameters

      • teamId: string
      • email: string
      • Optionaloptions: { ttlSeconds?: number }

      Returns Promise<{ createdAt: string; expiresAt: string; id: string; link: string }>

    • Deletes a Team only when the caller is its sole remaining admin member.

      Parameters

      • teamId: string

      Returns Promise<{ deleted: true }>

    • Demotes an admin only when another committed Team admin remains.

      Parameters

      • teamId: string
      • userId: string

      Returns Promise<{ updated: true }>

    • Redeems a current matching Join link atomically. New memberships are ordinary members with no application roles.

      Parameters

      • code: string

      Returns Promise<{ team: TeamSummary }>

    • Leaves an explicitly identified Team only while the caller is an ordinary member.

      Parameters

      • teamId: string

      Returns Promise<{ left: true }>

    • Lists active Join-link management metadata without recovering a capability.

      Parameters

      • teamId: string

      Returns Promise<{ links: TeamJoinLink[] }>

    • Lists a bounded safe membership directory for one Team the caller currently administers.

      Parameters

      • teamId: string

      Returns Promise<{ members: TeamMemberSummary[] }>

    • Promotes an ordinary member in an explicitly identified Team the caller currently administers.

      Parameters

      • teamId: string
      • userId: string

      Returns Promise<{ updated: true }>

    • Removes another Team member; callers leave through leave().

      Parameters

      • teamId: string
      • userId: string

      Returns Promise<{ removed: true }>

    • Renames an explicitly identified Team administered by the current user.

      Parameters

      • teamId: string
      • name: string

      Returns Promise<{ team: TeamSummary }>

    • Idempotently revokes an unused Join link scoped to one administered Team.

      Parameters

      • teamId: string
      • joinLinkId: string

      Returns Promise<{ revoked: true }>

    • Atomically adds and removes declared application roles for a member of one administered Team.

      Parameters

      Returns Promise<{ updated: true }>