Class ClientUser

A class representing the currently-logged in user.

Hierarchy

Constructors

Methods

  • Gets the Club ID for the currently logged-in user.

    Returns

    club id

    Returns number

  • Gets the user's status towards extra communications.

    Returns

    user's preference

    Returns boolean

  • Gets the post code of the currently-logged in user.

    Returns

    post code

    Returns string

  • Gets the amount of times per week the user exercised before joining parkrun (survey data)

    Returns

    Returns number

  • Gets data on if the user is a wheelchair user

    Returns

    user uses wheelchair?

    Returns boolean

  • Create a new freedom run, given the event number, run year, month, day and time of completion.

    Please note that Freedom Runs CANNOT be deleted.

    Returns

    The newly created Freedom Run ID.

    Throws

    ParkrunNetError ParkrunJS Networking Error.

    Throws

    Error Input data error.

    Example

    const user = [...]

    await user.createFreedomRun(953, "2020", "02", "15", "00:15:45")
    // example output - 166164059

    Parameters

    • eventNumber: number
    • runYear: string

      The year of the run (4 digits)

    • runMonth: string

      The month of the run. (2 digits)

    • runDay: string

      The day of the run. (2 digits)

    • runTime: string

      The time of the run (hh:mm:ss)

    Returns Promise<number>

  • Get the user's Parkrun Clubs (for milestone runs / duties)

    See

    if you want data from only a single club.

    Throws

    ParkrunJS Networking Error.

    Throws

    Error when no data is available, usually because of a new account with no runs.

    Example


    const user = .....


    await user.getClubs()

    // Example Response:

    [
    { type: ClubType.ADULT, club: Clubs.TWO_HUNDRED_AND_FIFTY },
    { type: ClubType.JUNIOR, club: Clubs.NONE },
    { type: ClubType.VOLUNTEER, club: Clubs.TWENTY_FIVE }
    ]

    Returns Promise<{ type: ClubType; club: Club }[]>

Properties

_core: Parkrun

Generated using TypeDoc